curl --request POST \
--url https://sreagent.app/api/v1/config/compliance_periods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ends_on": "<string>",
"name": "<string>",
"starts_on": "<string>"
}
'import requests
url = "https://sreagent.app/api/v1/config/compliance_periods"
payload = {
"ends_on": "<string>",
"name": "<string>",
"starts_on": "<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({ends_on: '<string>', name: '<string>', starts_on: '<string>'})
};
fetch('https://sreagent.app/api/v1/config/compliance_periods', 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/compliance_periods",
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([
'ends_on' => '<string>',
'name' => '<string>',
'starts_on' => '<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/compliance_periods"
payload := strings.NewReader("{\n \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\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/compliance_periods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/compliance_periods")
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 \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Create a compliance period
Open an audit window, which is the Compliance page’s Create period: the range of time one evidence export speaks for. Creating it writes no evidence and freezes nothing; the bundle is exported from the Compliance page once the window has passed, and the export stamps the period with its manifest’s hash so a bundle presented later can be matched to the window it claims to cover. Needs the compliance feature.
curl --request POST \
--url https://sreagent.app/api/v1/config/compliance_periods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ends_on": "<string>",
"name": "<string>",
"starts_on": "<string>"
}
'import requests
url = "https://sreagent.app/api/v1/config/compliance_periods"
payload = {
"ends_on": "<string>",
"name": "<string>",
"starts_on": "<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({ends_on: '<string>', name: '<string>', starts_on: '<string>'})
};
fetch('https://sreagent.app/api/v1/config/compliance_periods', 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/compliance_periods",
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([
'ends_on' => '<string>',
'name' => '<string>',
'starts_on' => '<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/compliance_periods"
payload := strings.NewReader("{\n \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\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/compliance_periods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/compliance_periods")
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 \"ends_on\": \"<string>\",\n \"name\": \"<string>\",\n \"starts_on\": \"<string>\"\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 last day it covers, as YYYY-MM-DD. It must be after starts_on.
One of iso27001_2022, soc2, cis_aws, nist_csf_2.
iso27001_2022, soc2, cis_aws, nist_csf_2 What the window is called, unique in this organization and at most 120 characters. The auditor's own name for it reads best (SOC 2 FY26).
The first day the window covers, as YYYY-MM-DD.
Response
Created.

