curl --request POST \
--url https://api.example.com/api/internal/ssr/compute \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
'import requests
url = "https://api.example.com/api/internal/ssr/compute"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2023-12-25', end_date: '2023-12-25'})
};
fetch('https://api.example.com/api/internal/ssr/compute', 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.example.com/api/internal/ssr/compute",
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([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/internal/ssr/compute"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/api/internal/ssr/compute")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/internal/ssr/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"rows_inserted": 123,
"start": "2023-12-25",
"end": "2023-12-25"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Compute and ingest Reg SHO SSR restrictions from price
Run ssr_ingest.compute_ssr over the requested (or self-healed
default) date window and insert restricted (symbol, date) rows into
reg_sho_ssr_list.
Runs synchronously (unlike most /api/internal/ collectors, which
return 202 and background the work): the daily-timer call is a single
trailing week (or less, once the watermark is current), full-universe
aggregate, which completes well within normal HTTP timeouts. A
multi-year backfill call (explicit start_date/end_date) is expected
to be run manually/out-of-band and may take longer; there is no separate
status-poll seam for THIS endpoint — use GET /status to confirm the
result afterward.
Self-heal (Fix E): when the caller supplies NEITHER start_date nor
end_date (the daily-timer call), start is derived from
reg_sho_ssr_ingest_watermark instead of a fixed trailing week — the
day after the last completed run’s processed_through, or the usual
_DEFAULT_TRAILING_DAYS fallback if no watermark exists yet. This is
capped at _MAX_SELF_HEAL_SPAN_DAYS: a gap wider than that is clamped
(with a warning logged) rather than silently backfilling months of
history inline — a longer gap needs an explicit, operator-triggered
backfill call instead. If the watermark is already current (start > end), this is a no-op — compute_ssr is not called and
rows_inserted=0 is returned.
curl --request POST \
--url https://api.example.com/api/internal/ssr/compute \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
'import requests
url = "https://api.example.com/api/internal/ssr/compute"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2023-12-25', end_date: '2023-12-25'})
};
fetch('https://api.example.com/api/internal/ssr/compute', 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.example.com/api/internal/ssr/compute",
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([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/internal/ssr/compute"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/api/internal/ssr/compute")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/internal/ssr/compute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"rows_inserted": 123,
"start": "2023-12-25",
"end": "2023-12-25"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request body for POST /api/internal/ssr/compute.
If the caller supplies at least one of start_date/end_date, the
other field left None defaults independently to
most_recent_trading_day - 7d / most_recent_trading_day respectively.
When BOTH are None (the daily-timer call, and the common case) the
endpoint instead self-heals from reg_sho_ssr_ingest_watermark: it
resumes the day after the last successfully completed compute_ssr
run's processed_through watermark, falling back to the same 7-day
trailing window only if no watermark exists yet. This means a skipped
run (deploy window, outage) gets picked back up automatically on the
next daily call instead of silently leaving a hole beyond 7 days -- see
trigger_ssr_compute.