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.devices.register("a11ce0fa-0000-4000-8000-0000000000a1", {
device_name: "Mia's iPhone",
device_model: "iPhone15,2",
os_version: "18.5",
app_version: "1.4.0"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/devices" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
}'
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/devices",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
},
)
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(`{
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
}`)
req, _ := http.NewRequest("POST", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/devices", 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}/devices",
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([
'device_name' => '<string>',
'device_model' => '<string>',
'os_version' => '<string>',
'app_version' => '<string>',
'apns_token' => '<string>',
'capabilities' => [
'<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}/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_name\": \"<string>\",\n \"device_model\": \"<string>\",\n \"os_version\": \"<string>\",\n \"app_version\": \"<string>\",\n \"apns_token\": \"<string>\",\n \"capabilities\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/devices")
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 \"device_name\": \"<string>\",\n \"device_model\": \"<string>\",\n \"os_version\": \"<string>\",\n \"app_version\": \"<string>\",\n \"apns_token\": \"<string>\",\n \"capabilities\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"device": {
"id": "5e0a9c37-1b64-4d82-96f3-2c8a7e0b4d19",
"child_id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"platform_id": "nextdns",
"device_name": "Ada's iPhone",
"device_model": "iPhone15,3",
"os_version": "18.5",
"app_version": "2.4.0",
"apns_token": "8f7d3c1b2a90e64f5d8c7b6a1f0e9d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6",
"capabilities": [
"FamilyControls",
"ManagedSettings",
"DeviceActivity"
],
"enforcement_summary": {},
"last_seen_at": "2026-07-05T22:04:18Z",
"last_policy_version": 0,
"status": "active",
"created_at": "2026-06-18T14:32:07Z",
"updated_at": "2026-06-30T09:15:44Z"
},
"api_key": "dvk_test_3a9f1c7e5b2d8046a1f3c9e7b5d2086"
}{
"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": "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
}Devices
Register a device
Register a device for on-device policy enforcement. Returns a one-time API key the iOS app stores in Keychain.
POST
/
children
/
{childID}
/
devices
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.devices.register("a11ce0fa-0000-4000-8000-0000000000a1", {
device_name: "Mia's iPhone",
device_model: "iPhone15,2",
os_version: "18.5",
app_version: "1.4.0"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/devices" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
}'
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/devices",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
},
)
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(`{
"device_name": "Mia's iPhone",
"device_model": "iPhone15,2",
"os_version": "18.5",
"app_version": "1.4.0"
}`)
req, _ := http.NewRequest("POST", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/devices", 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}/devices",
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([
'device_name' => '<string>',
'device_model' => '<string>',
'os_version' => '<string>',
'app_version' => '<string>',
'apns_token' => '<string>',
'capabilities' => [
'<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}/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_name\": \"<string>\",\n \"device_model\": \"<string>\",\n \"os_version\": \"<string>\",\n \"app_version\": \"<string>\",\n \"apns_token\": \"<string>\",\n \"capabilities\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/devices")
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 \"device_name\": \"<string>\",\n \"device_model\": \"<string>\",\n \"os_version\": \"<string>\",\n \"app_version\": \"<string>\",\n \"apns_token\": \"<string>\",\n \"capabilities\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"device": {
"id": "5e0a9c37-1b64-4d82-96f3-2c8a7e0b4d19",
"child_id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"platform_id": "nextdns",
"device_name": "Ada's iPhone",
"device_model": "iPhone15,3",
"os_version": "18.5",
"app_version": "2.4.0",
"apns_token": "8f7d3c1b2a90e64f5d8c7b6a1f0e9d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6",
"capabilities": [
"FamilyControls",
"ManagedSettings",
"DeviceActivity"
],
"enforcement_summary": {},
"last_seen_at": "2026-07-05T22:04:18Z",
"last_policy_version": 0,
"status": "active",
"created_at": "2026-06-18T14:32:07Z",
"updated_at": "2026-06-30T09:15:44Z"
},
"api_key": "dvk_test_3a9f1c7e5b2d8046a1f3c9e7b5d2086"
}{
"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": "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
}Register an Apple device against a child to drive on-device enforcement (Screen Time / MDM-style
controls). Once registered, the device pulls its compiled policy and reports activity back.
curl -X POST https://phosra-api-sandbox-production.up.railway.app/api/v1/children/$CHILD_ID/devices \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Mia’s iPad","platform":"ios"}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
User-assigned device name (e.g. "Ada's iPhone").
Hardware model identifier (e.g. iPhone15,3).
Operating-system version reported by the device (e.g. 18.5).
Version of the Phosra app installed on the device.
Apple Push Notification service device token; null until the device registers for push.
Apple frameworks the device supports (e.g. FamilyControls, ManagedSettings, DeviceActivity)
⌘I