Signed curl (wire shape)
# Signed headers are per-request — compute with the SDK (Node tab). Body is {}.
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/c8ff82dd-4aa8-4a52-a235-ae13717eb4c8/rotate \
-H "Content-Type: application/json" \
-H "OCSS-Spec-Version: OCSS-v1.0-pre" \
-H 'Signature-Input: ocss=("@method" "@target-uri" "ocss-spec-version" "content-digest");created=1783315514;keyid="did:ocss:loopline#2026-06";alg="ed25519"' \
-H 'Signature: ocss=:<base64-ed25519-sig>:' \
-H 'Content-Digest: sha-256=:<base64-sha256-of-body>:' \
-d '{}'import { signRequest } from "@openchildsafety/ocss"
const BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
const seed = new Uint8Array(Buffer.from("bG9vcGxpbmUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE", "base64url"))
const keyID = "did:ocss:loopline#2026-06"
const bindingId = "c8ff82dd-4aa8-4a52-a235-ae13717eb4c8"
const t = `${BASE}/enforcement-endpoints/${bindingId}/rotate`
const h = signRequest({ method: "POST", targetURI: t, body: new TextEncoder().encode("{}"), keyID, seed, created: Math.floor(Date.now() / 1000) })
h["Content-Type"] = "application/json"
const res = await fetch(t, { method: "POST", headers: h, body: "{}" })
console.log(res.status, await res.json())
import requests
url = "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"endpoint_id_label": "a-bmtAOYzb-Yhhnw11lZtOLFPwD_ms0fnRNQnNgRe-Q"
}{
"error": "Bad Request",
"message": "id must be a uuid",
"code": 400,
"class": "malformed"
}{
"error": "Unauthorized",
"message": "exactly one Signature-Input and one Signature header are required",
"code": 401,
"class": "signature_invalid"
}{
"error": "Not Found",
"message": "unknown enforcement endpoint",
"code": 404,
"class": "not_found"
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}{
"error": "Bad Gateway",
"message": "downstream provider error",
"code": 502
}{
"error": "Service Unavailable",
"message": "census operation not yet available",
"code": 503
}OCSS Data-Plane
Rotate a bound endpoint's label
Issues a fresh §9.3(b) label for the binding identified by (UUID from the mint response). The prior label is invalidated immediately. The new label is returned once; it is never logged. Returns only endpoint_id_label (connect_secret is not rotated; it stays fixed per binding).
POST
/
enforcement-endpoints
/
{id}
/
rotate
Signed curl (wire shape)
# Signed headers are per-request — compute with the SDK (Node tab). Body is {}.
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/c8ff82dd-4aa8-4a52-a235-ae13717eb4c8/rotate \
-H "Content-Type: application/json" \
-H "OCSS-Spec-Version: OCSS-v1.0-pre" \
-H 'Signature-Input: ocss=("@method" "@target-uri" "ocss-spec-version" "content-digest");created=1783315514;keyid="did:ocss:loopline#2026-06";alg="ed25519"' \
-H 'Signature: ocss=:<base64-ed25519-sig>:' \
-H 'Content-Digest: sha-256=:<base64-sha256-of-body>:' \
-d '{}'import { signRequest } from "@openchildsafety/ocss"
const BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
const seed = new Uint8Array(Buffer.from("bG9vcGxpbmUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE", "base64url"))
const keyID = "did:ocss:loopline#2026-06"
const bindingId = "c8ff82dd-4aa8-4a52-a235-ae13717eb4c8"
const t = `${BASE}/enforcement-endpoints/${bindingId}/rotate`
const h = signRequest({ method: "POST", targetURI: t, body: new TextEncoder().encode("{}"), keyID, seed, created: Math.floor(Date.now() / 1000) })
h["Content-Type"] = "application/json"
const res = await fetch(t, { method: "POST", headers: h, body: "{}" })
console.log(res.status, await res.json())
import requests
url = "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"endpoint_id_label": "a-bmtAOYzb-Yhhnw11lZtOLFPwD_ms0fnRNQnNgRe-Q"
}{
"error": "Bad Request",
"message": "id must be a uuid",
"code": 400,
"class": "malformed"
}{
"error": "Unauthorized",
"message": "exactly one Signature-Input and one Signature header are required",
"code": 401,
"class": "signature_invalid"
}{
"error": "Not Found",
"message": "unknown enforcement endpoint",
"code": 404,
"class": "not_found"
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}{
"error": "Bad Gateway",
"message": "downstream provider error",
"code": 502
}{
"error": "Service Unavailable",
"message": "census operation not yet available",
"code": 503
}Issues a fresh §9.3(b) label for the binding identified by
Real
The prior label (
{id} (the binding_id from
the bind response). The prior label is invalidated
immediately — a subsequent profile GET on the old label returns 404. Only
endpoint_id_label is returned; the connect_secret is not rotated (it stays fixed per
binding).
Rotate on your window cadence to keep the bound-resolver label short-lived. Because rotation is
atomic and the old label dies instantly, poll the new label before discarding the old one only
if you cannot tolerate a single missed cycle.
Worked example
import { signRequest } from "@openchildsafety/ocss"
const BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
const seed = new Uint8Array(Buffer.from("bG9vcGxpbmUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE", "base64url"))
const keyID = "did:ocss:loopline#2026-06"
const bindingId = "c8ff82dd-4aa8-4a52-a235-ae13717eb4c8" // from the bind response
const targetURI = `${BASE}/enforcement-endpoints/${bindingId}/rotate`
const headers = signRequest({ method: "POST", targetURI, body: new TextEncoder().encode("{}"), keyID, seed, created: Math.floor(Date.now() / 1000) })
headers["Content-Type"] = "application/json"
const res = await fetch(targetURI, { method: "POST", headers, body: "{}" })
console.log(res.status, await res.json())
# sign_request(...) — the signer from /concepts/signing-requests.
import requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
SEED = "bG9vcGxpbmUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE"
KEYID = "did:ocss:loopline#2026-06"
binding_id = "c8ff82dd-4aa8-4a52-a235-ae13717eb4c8" # from the bind response
url = f"{BASE}/enforcement-endpoints/{binding_id}/rotate"
body = b"{}" # rotate has an empty JSON body
h = sign_request("POST", url, KEYID, SEED, body)
h["Content-Type"] = "application/json"
res = requests.post(url, data=body, headers=h)
print(res.status_code, res.json()) # -> 200 { endpoint_id_label }
// SignRequest(...) — the stdlib signer from /concepts/signing-requests.
package main
import (
"bytes"; "fmt"; "io"; "net/http"
)
func main() {
const (
base = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
seed = "bG9vcGxpbmUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE"
keyID = "did:ocss:loopline#2026-06"
bindingID = "c8ff82dd-4aa8-4a52-a235-ae13717eb4c8" // from the bind response
)
url := base + "/enforcement-endpoints/" + bindingID + "/rotate"
body := []byte("{}") // rotate has an empty JSON body
h, _ := SignRequest("POST", url, keyID, seed, body)
req, _ := http.NewRequest("POST", url, bytes.NewReader(body))
for k, v := range h {
req.Header.Set(k, v)
}
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(b)) // -> 200 { endpoint_id_label }
}
# Runnable signed openssl script: /concepts/signing-requests (swap the POST target for this
# rotate URL and use an empty body `{}`). Wire shape of the four headers:
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement-endpoints/c8ff82dd-4aa8-4a52-a235-ae13717eb4c8/rotate \
-H "Content-Type: application/json" \
-H "OCSS-Spec-Version: OCSS-v1.0-pre" \
-H 'Content-Digest: sha-256=:<std-base64 sha256("{}")>:' \
-H 'Signature-Input: ocss=("@method" "@target-uri" "ocss-spec-version" "content-digest");created=1783315514;keyid="did:ocss:loopline#2026-06";alg="ed25519"' \
-H 'Signature: ocss=:<std-base64 ed25519-sig>:' \
-d '{}'
The
sign_request / SignRequest helper is defined once in the
request-signing guide — its Python, Go, and curl+openssl
recipes are verified against this sandbox. Even an empty-body POST covers content-digest
(over the bytes {}).200 response (captured from the hosted sandbox):
{
"endpoint_id_label": "cOxEaug6hEkbx8lYQOM8NiBtLknSSup5zqXvMjRfHa8"
}
iGrFqzp4…) now returns 404 on
GET /enforcement-profiles/{endpoint_id}.Path Parameters
Binding UUID from the mint response (binding_id).
Response
Rotated. New label replaces the prior one immediately.
Binding rotation result. Source: EndpointHandlers.Rotate response in internal/ocsshttp/handler_endpoints.go. Returns a fresh label only.
Rotated high-entropy §9.3(b) label. Replaces the prior label immediately; the prior label returns 404 after rotation. Never log.
⌘I