curl --request POST \
--url https://app.trustivan.com/api/v1/authz/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"permission": "<string>",
"human_present": true
}
'import requests
url = "https://app.trustivan.com/api/v1/authz/decide"
payload = {
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"permission": "<string>",
"human_present": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: '<string>',
resource_type: '<string>',
resource_id: '<string>',
permission: '<string>',
human_present: true
})
};
fetch('https://app.trustivan.com/api/v1/authz/decide', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/authz/decide"
payload := strings.NewReader("{\n \"action\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"permission\": \"<string>\",\n \"human_present\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Check whether the caller may perform an action
The authorization broker. It answers about the CALLING principal only: an endpoint answering about an arbitrary principal would be an oracle for probing what other agents may do.
The decision is shaped like a policy verdict, and the resemblance is a requirement rather than a coincidence: immutable, reproducible, policy-versioned, and recording EVERY rule’s outcome including the rules that did not fire. A decision listing only its reasons for refusing cannot answer “what else was checked?”, which is the question asked about a permit that turned out to be wrong.
Five outcomes, not two:
allow: proceed.step_up: permitted, but prove a human is present first. The action is legitimate and the caller has the authority; what is missing is confidence a human is behind this particular request.deny: refused. Routine, and not a signal about the principal.quarantine: refused, AND this principal is now suspect. Stop using the credential; a human must review it.revoke: refused, and the credential is finished.
Each carries its obligation, so no caller has to re-derive what it
owes. Answers 200 for every decision including a refusal: the decision
IS the answer, and a 403 would conflate “the broker refused this
action” with “you may not ask the broker”, and invites intermediaries
to discard the reasoning.
curl --request POST \
--url https://app.trustivan.com/api/v1/authz/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"permission": "<string>",
"human_present": true
}
'import requests
url = "https://app.trustivan.com/api/v1/authz/decide"
payload = {
"action": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"permission": "<string>",
"human_present": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: '<string>',
resource_type: '<string>',
resource_id: '<string>',
permission: '<string>',
human_present: true
})
};
fetch('https://app.trustivan.com/api/v1/authz/decide', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/authz/decide"
payload := strings.NewReader("{\n \"action\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"permission\": \"<string>\",\n \"human_present\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
Response
The decision, with every rule's outcome and the obligation it carries.