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.compliance.create({
family_id: "f0000000-0000-4000-8000-0000000000f1",
platform_id: "fire_tablet",
credentials: "oauth_or_manual_token_here"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/compliance" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/compliance",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
},
)
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(`{
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
}`)
req, _ := http.NewRequest("POST", base+"/compliance", 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/compliance",
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([
'family_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'platform_id' => '<string>',
'credentials' => '<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/compliance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"platform_id\": \"<string>\",\n \"credentials\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/compliance")
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 \"family_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"platform_id\": \"<string>\",\n \"credentials\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "e1a7c3f9-45b2-4d68-9c01-72f6b8d34a05",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"platform_id": "nextdns",
"status": "verified",
"external_id": "nextdns:profile:a1b2c3",
"last_enforcement_at": "2026-06-30T09:15:52Z",
"last_enforcement_status": "success",
"verified_at": "2026-06-19T08:47:30Z"
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Conflict",
"message": "resource already exists",
"code": 409
}{
"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
}Compliance
Connect a platform
Connect a platform to the family by providing credentials for verification.
POST
/
compliance
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.compliance.create({
family_id: "f0000000-0000-4000-8000-0000000000f1",
platform_id: "fire_tablet",
credentials: "oauth_or_manual_token_here"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/compliance" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/compliance",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
},
)
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(`{
"family_id": "f0000000-0000-4000-8000-0000000000f1",
"platform_id": "fire_tablet",
"credentials": "oauth_or_manual_token_here"
}`)
req, _ := http.NewRequest("POST", base+"/compliance", 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/compliance",
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([
'family_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'platform_id' => '<string>',
'credentials' => '<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/compliance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"platform_id\": \"<string>\",\n \"credentials\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/compliance")
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 \"family_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"platform_id\": \"<string>\",\n \"credentials\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "e1a7c3f9-45b2-4d68-9c01-72f6b8d34a05",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"platform_id": "nextdns",
"status": "verified",
"external_id": "nextdns:profile:a1b2c3",
"last_enforcement_at": "2026-06-30T09:15:52Z",
"last_enforcement_status": "success",
"verified_at": "2026-06-19T08:47:30Z"
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Conflict",
"message": "resource already exists",
"code": 409
}{
"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
}A compliance link is a live connection between a family and a platform (the thing enforcement
pushes to). Connect a platform, re-verify it, trigger enforcement for just that link, or disconnect.
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/compliance \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"family_id":"...","platform_id":"fire_tablet"}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Platform connected
Unique identifier for this resource.
Identifier of the family this resource belongs to.
Identifier of the associated platform.
Current lifecycle state of the resource.
Available options:
verified, unverified, error Identifier of the associated external.
RFC 3339 timestamp.
Outcome of the most recent enforcement run against this link (e.g. success, partial, error).
RFC 3339 timestamp.
⌘I