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.children.create("f0000000-0000-4000-8000-0000000000f1", {
name: "Mia",
birth_date: "2015-06-01"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/families/f0000000-0000-4000-8000-0000000000f1/children" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mia",
"birth_date": "2015-06-01"
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/families/f0000000-0000-4000-8000-0000000000f1/children",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"name": "Mia",
"birth_date": "2015-06-01"
},
)
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(`{
"name": "Mia",
"birth_date": "2015-06-01"
}`)
req, _ := http.NewRequest("POST", base+"/families/f0000000-0000-4000-8000-0000000000f1/children", 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/families/{familyID}/children",
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([
'name' => '<string>',
'birth_date' => '2023-12-25'
]),
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/families/{familyID}/children")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"birth_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/families/{familyID}/children")
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 \"name\": \"<string>\",\n \"birth_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"name": "Ada",
"birth_date": "2015-04-10T00:00:00Z",
"avatar_url": "https://cdn.phosra.com/avatars/ada.png",
"created_at": "2026-06-18T14:32:07Z"
}{
"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": "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
}Children
Add a child
Add child to family
POST
/
families
/
{familyID}
/
children
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.children.create("f0000000-0000-4000-8000-0000000000f1", {
name: "Mia",
birth_date: "2015-06-01"
});
console.log(result);curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/families/f0000000-0000-4000-8000-0000000000f1/children" \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mia",
"birth_date": "2015-06-01"
}'
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.post(
f"{BASE}/families/f0000000-0000-4000-8000-0000000000f1/children",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
json={
"name": "Mia",
"birth_date": "2015-06-01"
},
)
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(`{
"name": "Mia",
"birth_date": "2015-06-01"
}`)
req, _ := http.NewRequest("POST", base+"/families/f0000000-0000-4000-8000-0000000000f1/children", 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/families/{familyID}/children",
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([
'name' => '<string>',
'birth_date' => '2023-12-25'
]),
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/families/{familyID}/children")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"birth_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/families/{familyID}/children")
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 \"name\": \"<string>\",\n \"birth_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ca02f5d1-fee8-4201-b5ca-fdc8be506e1e",
"family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
"name": "Ada",
"birth_date": "2015-04-10T00:00:00Z",
"avatar_url": "https://cdn.phosra.com/avatars/ada.png",
"created_at": "2026-06-18T14:32:07Z"
}{
"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": "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
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Child added
Unique identifier for this resource.
Identifier of the family this resource belongs to.
Human-readable display name.
Child's date of birth (YYYY-MM-DD). Used to derive the age-appropriate policy.
URL of the profile image.
RFC 3339 timestamp of when the resource was created.
⌘I