SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.enforcement.trigger("a11ce0fa-0000-4000-8000-0000000000a1");
console.log(result);
curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform_ids": [
"fire_tablet"
]
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"platform_ids": [
"fire_tablet"
]
},
)
print(res.status_code, res.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
body := bytes.NewBufferString(`{
"platform_ids": [
"fire_tablet"
]
}`)
req, _ := http.NewRequest("POST", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce",
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([
'platform_ids' => [
'<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;
}HttpResponse<String> response = Unirest.post("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce")
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 \"platform_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "cf476742-4715-473c-bfac-64d39571ae5c",
"child_id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"policy_id": "7b3e9c04-2d1a-4f68-9e5b-8c07a1f34d29",
"trigger_type": "manual",
"status": "running",
"started_at": "2026-07-06T04:26:01.337741754Z",
"created_at": "2026-07-06T04:26:01.337745101Z"
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Forbidden",
"message": "not a member of this family",
"code": 403
}{
"error": "Not Found",
"message": "policy not found",
"code": 404
}{
"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": "downstream provider unavailable",
"code": 503
}Enforcement
Trigger enforcement
Push the child’s active policy rules to connected platforms. If platform_ids is provided, only those platforms are targeted; otherwise enforcement fans…
POST
/
children
/
{childID}
/
enforce
SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.enforcement.trigger("a11ce0fa-0000-4000-8000-0000000000a1");
console.log(result);
curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform_ids": [
"fire_tablet"
]
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"platform_ids": [
"fire_tablet"
]
},
)
print(res.status_code, res.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
body := bytes.NewBufferString(`{
"platform_ids": [
"fire_tablet"
]
}`)
req, _ := http.NewRequest("POST", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/enforce", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce",
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([
'platform_ids' => [
'<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;
}HttpResponse<String> response = Unirest.post("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/enforce")
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 \"platform_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "cf476742-4715-473c-bfac-64d39571ae5c",
"child_id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"policy_id": "7b3e9c04-2d1a-4f68-9e5b-8c07a1f34d29",
"trigger_type": "manual",
"status": "running",
"started_at": "2026-07-06T04:26:01.337741754Z",
"created_at": "2026-07-06T04:26:01.337745101Z"
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Forbidden",
"message": "not a member of this family",
"code": 403
}{
"error": "Not Found",
"message": "policy not found",
"code": 404
}{
"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": "downstream provider unavailable",
"code": 503
}Enforcement pushes a child’s active policy out to every connected platform and returns a job you
can poll. Trigger it, then watch the job and inspect per-platform results.
The write confirms the job was queued — it does not guarantee every platform applied the rule.
Track completion with Get enforcement job status
and per-platform outcomes with
Get job results.
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/children/$CHILD_ID/enforce \
-H "Authorization: Bearer $PHOSRA_API_KEY"
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Optional list of platform IDs to target. If omitted, pushes to ALL connected platforms.
Response
Enforcement job started
Unique identifier for this resource.
Identifier of the child this resource belongs to.
Identifier of the policy this resource belongs to.
What initiated the job (e.g. manual, scheduled, policy_change).
Available options:
manual, auto, webhook Current lifecycle state of the resource.
Available options:
pending, running, completed, failed, partial RFC 3339 timestamp of when the job started running.
RFC 3339 timestamp of when the job finished.
RFC 3339 timestamp of when the resource was created.