curl --request GET \
--url https://api.trulayer.ai/v1/policies/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/policies/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trulayer.ai/v1/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trulayer.ai/v1/policies/{id}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trulayer.ai/v1/policies/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trulayer.ai/v1/policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/policies/{id}")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"status": "draft",
"rule_yaml": "<string>",
"trigger_type": "eval_score",
"action_type": "retry",
"rollout_pct": 50,
"dry_run": true,
"created_by": "<string>",
"max_retry_depth": 5,
"max_cascade_depth": 10
}{
"error": "<string>"
}Fetch a single policy (TRU-67 Phase 1)
Dashboard-only. Returns 404 when the row is not in the caller’s tenant.
curl --request GET \
--url https://api.trulayer.ai/v1/policies/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/policies/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trulayer.ai/v1/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trulayer.ai/v1/policies/{id}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trulayer.ai/v1/policies/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trulayer.ai/v1/policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/policies/{id}")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"status": "draft",
"rule_yaml": "<string>",
"trigger_type": "eval_score",
"action_type": "retry",
"rollout_pct": 50,
"dry_run": true,
"created_by": "<string>",
"max_retry_depth": 5,
"max_cascade_depth": 10
}{
"error": "<string>"
}Authorizations
SDK API key (tl_...) or Clerk session JWT
Path Parameters
Response
Policy
draft, active, paused, archived Raw YAML DSL as authored. Opaque to the server in Phase 1.
Denormalised summary of the when: clause for fast filtering.
eval_score, anomaly, failure_rate Denormalised summary of the then: clause for fast filtering.
retry, fallback_model, route_pct, block, escalate Staged-rollout percentage. 0 means the policy is authored but inactive.
0 <= x <= 100When true, the evaluator records observations without applying the action.
Clerk user ID of the author.
Per-policy retry depth cap (TRU-362). When the executor counts
this many or more previously-executed retry actions on a trace
for this policy, the next retry is auto-converted to an
escalate action and routed through the HITL pending_approval
queue. Default 3.
1 <= x <= 10Per-policy cascade depth cap (TRU-371). Counts every
remediation action on the trace — retry plus
fallback_model plus prompt_modification — across all
policies. When the count reaches this many, the next
remediation is auto-converted to escalate and parked in
the HITL queue. Distinct from max_retry_depth which
counts retries only; both gates run per Execute call and
whichever fires first wins. Default 5.
1 <= x <= 20