Automations
Update an automation
Changes an automation. Send only what changes. In configuration, each field you send replaces the current value, and fields you leave out are kept. Changing only enabled turns the automation on or off without saving a new version.
PATCH
/
automations
/
{automationId}
Update an automation
curl --request PATCH \
--url https://superlog.sh/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"contextAccountIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"maxModelRequests": 500,
"maxOutputTokensPerRequest": 50128,
"maxRuntimeSeconds": 1830,
"model": "<string>",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"toolPolicy": "full",
"triggers": [
{
"channelIds": [
"<string>"
],
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"description": "<string>",
"enabled": true,
"name": "<string>"
}
'import requests
url = "https://superlog.sh/api/v1/automations/{automationId}"
payload = {
"configuration": {
"contextAccountIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"maxModelRequests": 500,
"maxOutputTokensPerRequest": 50128,
"maxRuntimeSeconds": 1830,
"model": "<string>",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"toolPolicy": "full",
"triggers": [
{
"channelIds": ["<string>"],
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"description": "<string>",
"enabled": True,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
contextAccountIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
maxModelRequests: 500,
maxOutputTokensPerRequest: 50128,
maxRuntimeSeconds: 1830,
model: '<string>',
notifications: [
{
channelId: '<string>',
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
kind: 'slack'
}
],
prompt: '<string>',
repositoryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
toolPolicy: 'full',
triggers: [
{
channelIds: ['<string>'],
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
kind: 'slack'
}
],
workspaceSecretIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
description: '<string>',
enabled: true,
name: '<string>'
})
};
fetch('https://superlog.sh/api/v1/automations/{automationId}', 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://superlog.sh/api/v1/automations/{automationId}",
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([
'configuration' => [
'contextAccountIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'maxModelRequests' => 500,
'maxOutputTokensPerRequest' => 50128,
'maxRuntimeSeconds' => 1830,
'model' => '<string>',
'notifications' => [
[
'channelId' => '<string>',
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'kind' => 'slack'
]
],
'prompt' => '<string>',
'repositoryIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'toolPolicy' => 'full',
'triggers' => [
[
'channelIds' => [
'<string>'
],
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'kind' => 'slack'
]
],
'workspaceSecretIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'description' => '<string>',
'enabled' => true,
'name' => '<string>'
]),
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://superlog.sh/api/v1/automations/{automationId}"
payload := strings.NewReader("{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://superlog.sh/api/v1/automations/{automationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/automations/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"configuration": {
"contextAccountIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"harness": "codex",
"maxModelRequests": 123,
"maxOutputTokensPerRequest": 123,
"maxRuntimeSeconds": 123,
"model": "<string>",
"modelProvider": "openai",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"toolPolicy": "full",
"triggers": [
{
"channelIds": [
"<string>"
],
"eventMode": "mentions",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}Authorizations
A workspace API key, created in Superlog under Settings → API keys.
Path Parameters
Automation ID.
Body
application/json
Response
OK
Show child attributes
Show child attributes
⌘I
Update an automation
curl --request PATCH \
--url https://superlog.sh/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"contextAccountIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"maxModelRequests": 500,
"maxOutputTokensPerRequest": 50128,
"maxRuntimeSeconds": 1830,
"model": "<string>",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"toolPolicy": "full",
"triggers": [
{
"channelIds": [
"<string>"
],
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"description": "<string>",
"enabled": true,
"name": "<string>"
}
'import requests
url = "https://superlog.sh/api/v1/automations/{automationId}"
payload = {
"configuration": {
"contextAccountIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"maxModelRequests": 500,
"maxOutputTokensPerRequest": 50128,
"maxRuntimeSeconds": 1830,
"model": "<string>",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"toolPolicy": "full",
"triggers": [
{
"channelIds": ["<string>"],
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"description": "<string>",
"enabled": True,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
contextAccountIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
maxModelRequests: 500,
maxOutputTokensPerRequest: 50128,
maxRuntimeSeconds: 1830,
model: '<string>',
notifications: [
{
channelId: '<string>',
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
kind: 'slack'
}
],
prompt: '<string>',
repositoryIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
toolPolicy: 'full',
triggers: [
{
channelIds: ['<string>'],
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
kind: 'slack'
}
],
workspaceSecretIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
description: '<string>',
enabled: true,
name: '<string>'
})
};
fetch('https://superlog.sh/api/v1/automations/{automationId}', 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://superlog.sh/api/v1/automations/{automationId}",
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([
'configuration' => [
'contextAccountIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'maxModelRequests' => 500,
'maxOutputTokensPerRequest' => 50128,
'maxRuntimeSeconds' => 1830,
'model' => '<string>',
'notifications' => [
[
'channelId' => '<string>',
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'kind' => 'slack'
]
],
'prompt' => '<string>',
'repositoryIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'toolPolicy' => 'full',
'triggers' => [
[
'channelIds' => [
'<string>'
],
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'kind' => 'slack'
]
],
'workspaceSecretIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'description' => '<string>',
'enabled' => true,
'name' => '<string>'
]),
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://superlog.sh/api/v1/automations/{automationId}"
payload := strings.NewReader("{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://superlog.sh/api/v1/automations/{automationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/automations/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"configuration\": {\n \"contextAccountIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"maxModelRequests\": 500,\n \"maxOutputTokensPerRequest\": 50128,\n \"maxRuntimeSeconds\": 1830,\n \"model\": \"<string>\",\n \"notifications\": [\n {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"prompt\": \"<string>\",\n \"repositoryIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"toolPolicy\": \"full\",\n \"triggers\": [\n {\n \"channelIds\": [\n \"<string>\"\n ],\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"kind\": \"slack\"\n }\n ],\n \"workspaceSecretIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"automation": {
"configuration": {
"contextAccountIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"harness": "codex",
"maxModelRequests": 123,
"maxOutputTokensPerRequest": 123,
"maxRuntimeSeconds": 123,
"model": "<string>",
"modelProvider": "openai",
"notifications": [
{
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"prompt": "<string>",
"repositoryIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"toolPolicy": "full",
"triggers": [
{
"channelIds": [
"<string>"
],
"eventMode": "mentions",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "slack"
}
],
"workspaceSecretIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}