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>",
"auto_dispatch": true,
"branch": "<string>",
"ci_fallback_to_platform": true,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<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>",
"auto_dispatch": True,
"branch": "<string>",
"ci_fallback_to_platform": True,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<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>',
auto_dispatch: true,
branch: '<string>',
ci_fallback_to_platform: true,
environment: '<string>',
fix_runner: '<string>',
path_prefix: '<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>',
'auto_dispatch' => true,
'branch' => '<string>',
'ci_fallback_to_platform' => true,
'environment' => '<string>',
'fix_runner' => '<string>',
'path_prefix' => '<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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\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 row 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>",
"auto_dispatch": true,
"branch": "<string>",
"ci_fallback_to_platform": true,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<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>",
"auto_dispatch": True,
"branch": "<string>",
"ci_fallback_to_platform": True,
"environment": "<string>",
"fix_runner": "<string>",
"path_prefix": "<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>',
auto_dispatch: true,
branch: '<string>',
ci_fallback_to_platform: true,
environment: '<string>',
fix_runner: '<string>',
path_prefix: '<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>',
'auto_dispatch' => true,
'branch' => '<string>',
'ci_fallback_to_platform' => true,
'environment' => '<string>',
'fix_runner' => '<string>',
'path_prefix' => '<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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\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 \"auto_dispatch\": true,\n \"branch\": \"<string>\",\n \"ci_fallback_to_platform\": true,\n \"environment\": \"<string>\",\n \"fix_runner\": \"<string>\",\n \"path_prefix\": \"<string>\",\n \"service\": \"<string>\",\n \"writable_extensions\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
An sre_ak_* API key holding the api:admin scope (or api:config_read, which every write refuses with read_only_key).
Body
The repository as owner/name (acme/api). It must be one this organization's GitHub App installation reaches.
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.
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 endpoint (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.
The branch this row applies to. Leave it out (or send null) for the all-branches row, which is what a repository with one fence wants.
For a repository on "opencode_ci": when no CI run starts within 5 minutes of the handover, send the same request to SRE Agent's own agent once, instead of failing it. false (the default) fails it, naming the likely causes. Applies to the whole repository.
The environment this row describes, e.g. production. Optional.
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 the fix in a GitHub Actions workflow in your repository and needs a plan that includes it. "self_hosted" runs the fix on a runner you register for this organization and needs a plan that includes it. The value applies to the whole repository, so it moves every row the repository has.
The one directory a proposed fix may write in, e.g. "terraform/", or "." for the whole repository. Left out, it is detected from the repository's layout the first time a fix runs and recorded here. A leading slash matches nothing, and .github/ is never writable whatever this says.
The alias SLIs, deploy events and fix requests may name this repository by. Optional: with no alias the repository's short name is used.
The file suffixes a proposed fix may touch, each starting with a dot (".tf", ".tfvars.json"). Defaults to .tf, .tfvars, .yaml, .yml. At least one is required when the field is sent.
Response
Created.

