Create a connector
curl --request POST \
--url https://sreagent.app/api/v1/config/connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": true,
"metadata": {}
}
'import requests
url = "https://sreagent.app/api/v1/config/connectors"
payload = {
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": True,
"metadata": {}
}
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({
config: {},
connector_type: '<string>',
name: '<string>',
enabled: true,
metadata: {}
})
};
fetch('https://sreagent.app/api/v1/config/connectors', 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/connectors",
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([
'config' => [
],
'connector_type' => '<string>',
'name' => '<string>',
'enabled' => true,
'metadata' => [
]
]),
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/connectors"
payload := strings.NewReader("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\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/connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/connectors")
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 \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}connectors
Create a connector
Create an infrastructure connector a runbook step can act through. connector_type is one of kubernetes, ssh, aws_ecs, aws_lambda, aws_ec2, aws_eks. aws_eks is for discovery: it lists EKS clusters and the workloads Container Insights reports, and like every AWS connector it also discovers the account-wide inventory (VPCs, subnets, security groups, load balancers, target groups, RDS, ACM). Its role needs exactly these read grants and nothing that writes: acm:ListCertificates, cloudwatch:ListMetrics, ec2:DescribeSecurityGroups, ec2:DescribeSubnets, ec2:DescribeVpcs, eks:DescribeCluster, eks:ListClusters, elasticloadbalancing:DescribeLoadBalancers, elasticloadbalancing:DescribeTargetGroups, rds:DescribeDBInstances. Runbook actions through it need their own grants. To reach EC2 instances via SSM, use aws_ec2 and grant the AWS credentials ssm:SendCommand. `config` holds the type-specific credentials: kubernetes -> {"kubeconfig":"..."}; ssh -> {"host","user","private_key","port"}; aws_* -> {"auth_type":"aws_assume_role"|"aws_access_keys", "role_arn"|"access_key_id"/"secret_access_key", "region"}. metadata labels drive connector selection when several of a type exist.
POST
/
connectors
Create a connector
curl --request POST \
--url https://sreagent.app/api/v1/config/connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": true,
"metadata": {}
}
'import requests
url = "https://sreagent.app/api/v1/config/connectors"
payload = {
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": True,
"metadata": {}
}
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({
config: {},
connector_type: '<string>',
name: '<string>',
enabled: true,
metadata: {}
})
};
fetch('https://sreagent.app/api/v1/config/connectors', 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/connectors",
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([
'config' => [
],
'connector_type' => '<string>',
'name' => '<string>',
'enabled' => true,
'metadata' => [
]
]),
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/connectors"
payload := strings.NewReader("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\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/connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/connectors")
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 \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\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
application/json
Response
Created.

