curl --request PUT \
--url https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"name": "<string>",
"trigger": {
"labels": [
"<string>"
],
"scope": "<string>",
"type": "issue_opened"
},
"dailyLimit": 5,
"instructions": null,
"signingSecret": "<string>",
"status": "on"
}
'import requests
url = "https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}"
payload = {
"name": "<string>",
"trigger": {
"labels": ["<string>"],
"scope": "<string>",
"type": "issue_opened"
},
"dailyLimit": 5,
"instructions": None,
"signingSecret": "<string>",
"status": "on"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
trigger: {labels: ['<string>'], scope: '<string>', type: 'issue_opened'},
dailyLimit: 5,
instructions: null,
signingSecret: '<string>',
status: 'on'
})
};
fetch('https://api.outerlayer.ai/v1/apps/{appId}/custom-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://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}",
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([
'name' => '<string>',
'trigger' => [
'labels' => [
'<string>'
],
'scope' => '<string>',
'type' => 'issue_opened'
],
'dailyLimit' => 5,
'instructions' => null,
'signingSecret' => '<string>',
'status' => 'on'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <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.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.put("https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"createdAt": "<string>",
"creator": {
"membershipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"dailyLimit": 123,
"failureStreak": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"name": "<string>",
"noticesTo": "creator",
"off": {
"at": "<string>",
"reason": "failed_runs"
},
"status": "on",
"trigger": {
"labels": [
"<string>"
],
"scope": "<string>",
"tracker": "github",
"type": "issue_opened"
},
"updatedAt": "<string>",
"hookId": "<string>",
"nextDueAt": "<string>",
"signingSecret": {
"setAt": "<string>",
"value": "<string>"
},
"whose": "members"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Replace a custom automation
Replaces the whole automation, so a field left out takes its default. To turn the automation on or off, send the whole body with a new status. The trigger type and, for a webhook automation, its sender cannot change. Send signingSecret to replace the secret of a Sentry or PagerDuty automation. A body with none keeps the stored secret. The change takes effect for the next event the automation answers. A save by a member sets the count of failed runs in a row to zero and clears the switch-off, so turning an automation back on, and the Keep it off action, both save. An automation with no creator takes the saving member as its creator. A creator that is set never changes.
curl --request PUT \
--url https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"name": "<string>",
"trigger": {
"labels": [
"<string>"
],
"scope": "<string>",
"type": "issue_opened"
},
"dailyLimit": 5,
"instructions": null,
"signingSecret": "<string>",
"status": "on"
}
'import requests
url = "https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}"
payload = {
"name": "<string>",
"trigger": {
"labels": ["<string>"],
"scope": "<string>",
"type": "issue_opened"
},
"dailyLimit": 5,
"instructions": None,
"signingSecret": "<string>",
"status": "on"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
trigger: {labels: ['<string>'], scope: '<string>', type: 'issue_opened'},
dailyLimit: 5,
instructions: null,
signingSecret: '<string>',
status: 'on'
})
};
fetch('https://api.outerlayer.ai/v1/apps/{appId}/custom-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://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}",
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([
'name' => '<string>',
'trigger' => [
'labels' => [
'<string>'
],
'scope' => '<string>',
'type' => 'issue_opened'
],
'dailyLimit' => 5,
'instructions' => null,
'signingSecret' => '<string>',
'status' => 'on'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <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.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.put("https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/apps/{appId}/custom-automations/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"trigger\": {\n \"labels\": [\n \"<string>\"\n ],\n \"scope\": \"<string>\",\n \"type\": \"issue_opened\"\n },\n \"dailyLimit\": 5,\n \"instructions\": null,\n \"signingSecret\": \"<string>\",\n \"status\": \"on\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"createdAt": "<string>",
"creator": {
"membershipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"dailyLimit": 123,
"failureStreak": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"name": "<string>",
"noticesTo": "creator",
"off": {
"at": "<string>",
"reason": "failed_runs"
},
"status": "on",
"trigger": {
"labels": [
"<string>"
],
"scope": "<string>",
"tracker": "github",
"type": "issue_opened"
},
"updatedAt": "<string>",
"hookId": "<string>",
"nextDueAt": "<string>",
"signingSecret": {
"setAt": "<string>",
"value": "<string>"
},
"whose": "members"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Body
The secret that Sentry or PagerDuty signs its requests with. Required to add a Sentry or PagerDuty automation. Send it again to replace the stored secret. OuterLayer never returns it. An Any JSON automation takes none, because OuterLayer makes its secret.
1 - 500