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.getResults("9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6");
console.log(result);
curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results" \
-H "Authorization: Bearer $PHOSRA_API_KEY"
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
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/enforcement/jobs/{jobID}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/{jobID}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/{jobID}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "5c1e9a37-6b48-42df-90a1-3e8f7c04b2d6",
"enforcement_job_id": "b8f04d2e-1c93-4a56-8e7f-05a91d6c3b28",
"compliance_link_id": "e1a7c3f9-45b2-4d68-9c01-72f6b8d34a05",
"platform_id": "nextdns",
"status": "pending",
"rules_applied": 0,
"rules_skipped": 0,
"rules_failed": 0,
"error_message": null,
"details": {},
"started_at": "2026-06-30T09:15:44Z",
"completed_at": "2026-06-30T09:15:52Z"
}
]{
"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
}Get job results per platform
Get enforcement job results per platform
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.getResults("9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6");
console.log(result);
curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results" \
-H "Authorization: Bearer $PHOSRA_API_KEY"
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/enforcement/jobs/9b2f4a1e-5c3d-4e2a-8f1b-2c963f66afa6/results", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
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/enforcement/jobs/{jobID}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/{jobID}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/enforcement/jobs/{jobID}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "5c1e9a37-6b48-42df-90a1-3e8f7c04b2d6",
"enforcement_job_id": "b8f04d2e-1c93-4a56-8e7f-05a91d6c3b28",
"compliance_link_id": "e1a7c3f9-45b2-4d68-9c01-72f6b8d34a05",
"platform_id": "nextdns",
"status": "pending",
"rules_applied": 0,
"rules_skipped": 0,
"rules_failed": 0,
"error_message": null,
"details": {},
"started_at": "2026-06-30T09:15:44Z",
"completed_at": "2026-06-30T09:15:52Z"
}
]{
"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
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Per-platform enforcement results
Unique identifier for this resource.
Unique identifier (UUID) for the related resource.
Unique identifier (UUID) for the related resource.
Identifier of the associated platform.
Current lifecycle state of the resource.
pending, running, completed, failed, partial Number of rules successfully applied to the target during this run.
Number of rules skipped because the target does not support that category.
Number of rules that returned an error while being applied.
Human-readable error detail when the operation failed; null on success.
Free-form provider response payload captured for debugging.
RFC 3339 timestamp of when the job started running.
RFC 3339 timestamp of when the job finished.