curl --request POST \
--url https://sreagent.app/api/v1/config/repo_settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo": "<string>",
"alerting_sns_topic_arn": "<string>",
"allow_ci_config": true,
"auto_dispatch": true,
"branch": "<string>",
"ci_fallback_to_platform": true,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<string>",
"path_prefixes": [
"<string>"
],
"service": "<string>",
"writable_extensions": [
"<string>"
]
}
'import requests
url = "https://sreagent.app/api/v1/config/repo_settings"
payload = {
"repo": "<string>",
"alerting_sns_topic_arn": "<string>",
"allow_ci_config": True,
"auto_dispatch": True,
"branch": "<string>",
"ci_fallback_to_platform": True,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<string>",
"path_prefixes": ["<string>"],
"service": "<string>",
"writable_extensions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repo: '<string>',
alerting_sns_topic_arn: '<string>',
allow_ci_config: true,
auto_dispatch: true,
branch: '<string>',
ci_fallback_to_platform: true,
environment: '<string>',
fix_runner: '<string>',
path_prefix: '<string>',
path_prefixes: ['<string>'],
service: '<string>',
writable_extensions: ['<string>']
})
};
fetch('https://sreagent.app/api/v1/config/repo_settings', 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://sreagent.app/api/v1/config/repo_settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'repo' => '<string>',
'alerting_sns_topic_arn' => '<string>',
'allow_ci_config' => true,
'auto_dispatch' => true,
'branch' => '<string>',
'ci_fallback_to_platform' => true,
'environment' => '<string>',
'fix_runner' => '<string>',
'path_prefix' => '<string>',
'path_prefixes' => [
'<string>'
],
'service' => '<string>',
'writable_extensions' => [
'<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://sreagent.app/api/v1/config/repo_settings"
payload := strings.NewReader("{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://sreagent.app/api/v1/config/repo_settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/repo_settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Create a repo setting
Create the settings for one repository the GitHub App can reach: the write fence remediation obeys, an optional service alias, and which runner executes the repository’s fix requests. A repository the App does not reach is refused rather than saved, because the fix pipeline would never read the row. Settings are optional: a repository with no row is still targetable, with its fence detected on first use. Answers the repository in the shape list_repo_settings answers.
curl --request POST \
--url https://sreagent.app/api/v1/config/repo_settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo": "<string>",
"alerting_sns_topic_arn": "<string>",
"allow_ci_config": true,
"auto_dispatch": true,
"branch": "<string>",
"ci_fallback_to_platform": true,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<string>",
"path_prefixes": [
"<string>"
],
"service": "<string>",
"writable_extensions": [
"<string>"
]
}
'import requests
url = "https://sreagent.app/api/v1/config/repo_settings"
payload = {
"repo": "<string>",
"alerting_sns_topic_arn": "<string>",
"allow_ci_config": True,
"auto_dispatch": True,
"branch": "<string>",
"ci_fallback_to_platform": True,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<string>",
"path_prefixes": ["<string>"],
"service": "<string>",
"writable_extensions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repo: '<string>',
alerting_sns_topic_arn: '<string>',
allow_ci_config: true,
auto_dispatch: true,
branch: '<string>',
ci_fallback_to_platform: true,
environment: '<string>',
fix_runner: '<string>',
path_prefix: '<string>',
path_prefixes: ['<string>'],
service: '<string>',
writable_extensions: ['<string>']
})
};
fetch('https://sreagent.app/api/v1/config/repo_settings', 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://sreagent.app/api/v1/config/repo_settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'repo' => '<string>',
'alerting_sns_topic_arn' => '<string>',
'allow_ci_config' => true,
'auto_dispatch' => true,
'branch' => '<string>',
'ci_fallback_to_platform' => true,
'environment' => '<string>',
'fix_runner' => '<string>',
'path_prefix' => '<string>',
'path_prefixes' => [
'<string>'
],
'service' => '<string>',
'writable_extensions' => [
'<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://sreagent.app/api/v1/config/repo_settings"
payload := strings.NewReader("{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://sreagent.app/api/v1/config/repo_settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/repo_settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repo\": \"<string>\",\n \"alerting_sns_topic_arn\": \"<string>\",\n \"allow_ci_config\": true,\n \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"path_prefixes\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
The SNS topic ARN an "Alarm on this" pull request for this repository should name in a generated alarm's alarm_actions, when one already exists for this repository's AWS account and region. Left unset, that pull request creates its own topic and subscription the first time and reuses it (by name) after that.
Whether fixes may change CI configuration (.github/, .circleci/, .gitlab-ci.yml, Jenkinsfile and similar) inside path_prefixes. Off by default. Each such change opens as a draft pull request that names the CI files and is never merged by SRE Agent, and CI files are never pushed onto a pull request whose auto-merge is on. With this on, a fix may change CI configuration, and the repository's CI runs that change as soon as the branch is pushed, with the repository's secrets, before anyone reviews the pull request. Every way a fix starts can make such a change: fix requests, @sre-agent change, automatic investigation and self-healing pull requests, and revise-on-review.
true (the default) sends this repository's fix requests to its runner as soon as they are made. false waits for a person: every request, from any source (the webhook included), is created and its card says it is waiting, but nothing is sent until someone presses Send on the card (or, for a request with no card, in its Control Tower drawer). Applies to the whole repository.
Who executes this repository's fix requests: platform, opencode_ci, self_hosted. "platform" is SRE Agent's own agent and needs nothing installed. "opencode_ci" runs in your own CI. Included in the Business and Enterprise plans. It needs a workflow in the repository referencing the published package segfaultpw/sre-agent-opencode. "self_hosted" runs on your own machine. Included in the Business and Enterprise plans. It needs a runner registered for this organization. The value applies to the whole repository, so it moves every row the repository has.
The directories a proposed fix may change in this repository, relative to its root, for example ["services/api/", "services/web/"], or ["."] for the whole repository. At most 20. No entry may sit inside another, start with a slash or contain ..; CI configuration paths need allow_ci_config. Sending it replaces the whole list; [] clears it, and the directories are then detected from the repository's layout the first time a fix runs. Send path_prefixes or path_prefix, not both.
20Response
Created.
Was this page helpful?