Change my agent
curl --request PUT \
--url https://api.openworklabs.com/v1/me/agent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"on": true,
"snooze": "tomorrow",
"mute": [],
"unmute": [],
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"hours": {
"startHour": 11,
"endHour": 12
},
"dailyCap": 5,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"sources": [
{
"source": "<string>",
"on": true,
"instruction": "<string>"
}
],
"undo": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/me/agent"
payload = {
"on": True,
"snooze": "tomorrow",
"mute": [],
"unmute": [],
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"hours": {
"startHour": 11,
"endHour": 12
},
"dailyCap": 5,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"sources": [
{
"source": "<string>",
"on": True,
"instruction": "<string>"
}
],
"undo": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
on: true,
snooze: 'tomorrow',
mute: [],
unmute: [],
preferences: {always: '<string>', never: '<string>', when: '<string>', how: '<string>'},
hours: {startHour: 11, endHour: 12},
dailyCap: 5,
quietWindow: {startHour: 11, endHour: 12},
sources: [{source: '<string>', on: true, instruction: '<string>'}],
undo: '<string>'
})
};
fetch('https://api.openworklabs.com/v1/me/agent', 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/me/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'on' => true,
'snooze' => 'tomorrow',
'mute' => [
],
'unmute' => [
],
'preferences' => [
'always' => '<string>',
'never' => '<string>',
'when' => '<string>',
'how' => '<string>'
],
'hours' => [
'startHour' => 11,
'endHour' => 12
],
'dailyCap' => 5,
'quietWindow' => [
'startHour' => 11,
'endHour' => 12
],
'sources' => [
[
'source' => '<string>',
'on' => true,
'instruction' => '<string>'
]
],
'undo' => '<string>'
]),
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/me/agent"
payload := strings.NewReader("{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.openworklabs.com/v1/me/agent")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/me/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"on": true,
"snoozedUntil": "2023-11-07T05:31:56Z",
"responsibilities": [
{
"id": "morning_brief",
"label": "<string>",
"tells": "<string>",
"enabled": true,
"muted": true
}
],
"destination": {
"kind": "workbot_dm",
"name": "<string>",
"blocked": "slack_app_not_installed"
},
"workingHours": {
"workingDays": "weekdays",
"startHour": 123,
"endHour": 123,
"dailyCap": 123
},
"nextCheckAt": "2023-11-07T05:31:56Z",
"timeZone": "<string>",
"lastCheck": {
"id": "<string>",
"at": "2023-11-07T05:31:56Z",
"kind": "morning",
"outcome": "sent",
"reason": "sent",
"headline": "<string>",
"summary": "<string>",
"responsibilities": [
"morning_brief"
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"connectionId": "<string>"
}
],
"slackUrl": "<string>",
"fix": "reconnect_google"
},
"todayChecks": [
{
"id": "<string>",
"at": "2023-11-07T05:31:56Z",
"kind": "morning",
"outcome": "sent",
"reason": "sent",
"headline": "<string>",
"summary": "<string>",
"responsibilities": [
"morning_brief"
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"connectionId": "<string>"
}
],
"slackUrl": "<string>",
"fix": "reconnect_google"
}
],
"sentToday": 4503599627370495,
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"limits": {
"workingDays": "weekdays",
"startHour": 0,
"endHour": 0,
"dailyCap": 0,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"admin": {
"startHour": 0,
"endHour": 0,
"dailyCap": 0
},
"narrowed": {
"hours": true,
"dailyCap": true
}
},
"changes": [
{
"id": "<string>",
"field": "always",
"sourceId": "<string>",
"summary": "<string>",
"source": "chat",
"at": "2023-11-07T05:31:56Z",
"undone": true
}
],
"sources": [
{
"id": "<string>",
"kind": "calendar",
"name": "<string>",
"connections": [
{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"state": "connected"
}
],
"policy": "everyone",
"on": true,
"instruction": "<string>",
"lastReadAt": "2023-11-07T05:31:56Z"
}
],
"link": "<string>",
"saved": {
"changes": [
"<string>"
],
"reply": "<string>",
"link": "<string>",
"connect": [
{
"name": "<string>",
"href": "<string>"
}
]
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "unauthorized"
}{
"error": "feature_disabled",
"feature": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Users
Change my agent
Changes the signed-in member's own agent, as they would say it: turn it on or off (`on`), snooze it until the next working morning or resume (`snooze: "tomorrow"` or null), stop or restart one kind of message (`mute` / `unmute`: morning_brief, meeting_prep, calendar_changes, waiting_on_you). With My agent on (workbotAgentLibrary) also: what they want in their own words (`preferences.always`, `.never`, `.when`, `.how`; plain text, an empty string clears one), narrower working hours (`hours: {startHour, endHour}`, null for the admin's), a lower daily limit (`dailyCap`, null for the admin's), hours inside the day when only urgent messages go out (`quietWindow: {startHour, endHour}`, null removes it), `sources`: what the agent reads, by source id or name, each with `on` and/or an `instruction` in the member's words (for "also look at my Granola for context, especially action items after meetings, and skip Linear" send [{source: "Granola", on: true, instruction: "Use for meeting context and action items after meetings."}, {source: "Linear", on: false}]); and `undo`: "last" reverts the member's last save, a change id reverts one change (send undo on its own). A source the admin didn't allow answers 400 source_not_allowed, one that is on for everyone can't be turned off (400 source_locked), each with a message that says who can change it; a source the member hasn't connected is saved and `saved.connect` names where to connect it. For "between 12 and 2 only urgent stuff, stop telling me about calendar changes" send preferences.when, quietWindow 12–14 and mute calendar_changes in one call. A member can only narrow the admin's limits: wider hours or a higher limit answer 400 limit_wider_than_admin with a message to relay. The response's `saved.reply` says exactly what was saved, "Reply \"undo\" to revert." and the link to My agent: reply with it as is, in plain text. Organization settings and limits still apply. Requires the workbotProactive feature and Workbot on this deployment.
PUT
/
v1
/
me
/
agent
Change my agent
curl --request PUT \
--url https://api.openworklabs.com/v1/me/agent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"on": true,
"snooze": "tomorrow",
"mute": [],
"unmute": [],
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"hours": {
"startHour": 11,
"endHour": 12
},
"dailyCap": 5,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"sources": [
{
"source": "<string>",
"on": true,
"instruction": "<string>"
}
],
"undo": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/me/agent"
payload = {
"on": True,
"snooze": "tomorrow",
"mute": [],
"unmute": [],
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"hours": {
"startHour": 11,
"endHour": 12
},
"dailyCap": 5,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"sources": [
{
"source": "<string>",
"on": True,
"instruction": "<string>"
}
],
"undo": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
on: true,
snooze: 'tomorrow',
mute: [],
unmute: [],
preferences: {always: '<string>', never: '<string>', when: '<string>', how: '<string>'},
hours: {startHour: 11, endHour: 12},
dailyCap: 5,
quietWindow: {startHour: 11, endHour: 12},
sources: [{source: '<string>', on: true, instruction: '<string>'}],
undo: '<string>'
})
};
fetch('https://api.openworklabs.com/v1/me/agent', 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/me/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'on' => true,
'snooze' => 'tomorrow',
'mute' => [
],
'unmute' => [
],
'preferences' => [
'always' => '<string>',
'never' => '<string>',
'when' => '<string>',
'how' => '<string>'
],
'hours' => [
'startHour' => 11,
'endHour' => 12
],
'dailyCap' => 5,
'quietWindow' => [
'startHour' => 11,
'endHour' => 12
],
'sources' => [
[
'source' => '<string>',
'on' => true,
'instruction' => '<string>'
]
],
'undo' => '<string>'
]),
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/me/agent"
payload := strings.NewReader("{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.openworklabs.com/v1/me/agent")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/me/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"on\": true,\n \"snooze\": \"tomorrow\",\n \"mute\": [],\n \"unmute\": [],\n \"preferences\": {\n \"always\": \"<string>\",\n \"never\": \"<string>\",\n \"when\": \"<string>\",\n \"how\": \"<string>\"\n },\n \"hours\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"dailyCap\": 5,\n \"quietWindow\": {\n \"startHour\": 11,\n \"endHour\": 12\n },\n \"sources\": [\n {\n \"source\": \"<string>\",\n \"on\": true,\n \"instruction\": \"<string>\"\n }\n ],\n \"undo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"on": true,
"snoozedUntil": "2023-11-07T05:31:56Z",
"responsibilities": [
{
"id": "morning_brief",
"label": "<string>",
"tells": "<string>",
"enabled": true,
"muted": true
}
],
"destination": {
"kind": "workbot_dm",
"name": "<string>",
"blocked": "slack_app_not_installed"
},
"workingHours": {
"workingDays": "weekdays",
"startHour": 123,
"endHour": 123,
"dailyCap": 123
},
"nextCheckAt": "2023-11-07T05:31:56Z",
"timeZone": "<string>",
"lastCheck": {
"id": "<string>",
"at": "2023-11-07T05:31:56Z",
"kind": "morning",
"outcome": "sent",
"reason": "sent",
"headline": "<string>",
"summary": "<string>",
"responsibilities": [
"morning_brief"
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"connectionId": "<string>"
}
],
"slackUrl": "<string>",
"fix": "reconnect_google"
},
"todayChecks": [
{
"id": "<string>",
"at": "2023-11-07T05:31:56Z",
"kind": "morning",
"outcome": "sent",
"reason": "sent",
"headline": "<string>",
"summary": "<string>",
"responsibilities": [
"morning_brief"
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"connectionId": "<string>"
}
],
"slackUrl": "<string>",
"fix": "reconnect_google"
}
],
"sentToday": 4503599627370495,
"preferences": {
"always": "<string>",
"never": "<string>",
"when": "<string>",
"how": "<string>"
},
"limits": {
"workingDays": "weekdays",
"startHour": 0,
"endHour": 0,
"dailyCap": 0,
"quietWindow": {
"startHour": 11,
"endHour": 12
},
"admin": {
"startHour": 0,
"endHour": 0,
"dailyCap": 0
},
"narrowed": {
"hours": true,
"dailyCap": true
}
},
"changes": [
{
"id": "<string>",
"field": "always",
"sourceId": "<string>",
"summary": "<string>",
"source": "chat",
"at": "2023-11-07T05:31:56Z",
"undone": true
}
],
"sources": [
{
"id": "<string>",
"kind": "calendar",
"name": "<string>",
"connections": [
{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"state": "connected"
}
],
"policy": "everyone",
"on": true,
"instruction": "<string>",
"lastReadAt": "2023-11-07T05:31:56Z"
}
],
"link": "<string>",
"saved": {
"changes": [
"<string>"
],
"reply": "<string>",
"link": "<string>",
"connect": [
{
"name": "<string>",
"href": "<string>"
}
]
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "unauthorized"
}{
"error": "feature_disabled",
"feature": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
denApiKeybearerAuth
Organization API key passed as the x-api-key header. The raw key is the header value; do not prefix it with Bearer.
Body
application/json
Available options:
tomorrow Maximum array length:
4Available options:
morning_brief, meeting_prep, calendar_changes, waiting_on_you Maximum array length:
4Available options:
morning_brief, meeting_prep, calendar_changes, waiting_on_you Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
1 <= x <= 10Show child attributes
Show child attributes
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Required string length:
1 - 64Response
The member's agent after the change.
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
0 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?