Ask about up to 32 actions at once
curl --request POST \
--url https://access.noetive.io/access/v1/evaluations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": {
"type": "agent",
"id": "ag_01jb8x4m2fe0bv3c7y1tq9k2rd"
},
"action": {
"name": "semantik.publish"
},
"evaluations": [
{
"resource": {
"type": "Namespace",
"id": "ns_01jb8x4m2fe0bv3c7y1tq9k2rd"
}
},
{
"resource": {
"type": "Namespace",
"id": "ns_01jb8x4m3ae0bv3c8m5n7r2wxz"
}
}
]
}
'import requests
url = "https://access.noetive.io/access/v1/evaluations"
payload = {
"subject": {
"type": "agent",
"id": "ag_01jb8x4m2fe0bv3c7y1tq9k2rd"
},
"action": { "name": "semantik.publish" },
"evaluations": [{ "resource": {
"type": "Namespace",
"id": "ns_01jb8x4m2fe0bv3c7y1tq9k2rd"
} }, { "resource": {
"type": "Namespace",
"id": "ns_01jb8x4m3ae0bv3c8m5n7r2wxz"
} }]
}
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({
subject: {type: 'agent', id: 'ag_01jb8x4m2fe0bv3c7y1tq9k2rd'},
action: {name: 'semantik.publish'},
evaluations: [
{resource: {type: 'Namespace', id: 'ns_01jb8x4m2fe0bv3c7y1tq9k2rd'}},
{resource: {type: 'Namespace', id: 'ns_01jb8x4m3ae0bv3c8m5n7r2wxz'}}
]
})
};
fetch('https://access.noetive.io/access/v1/evaluations', 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://access.noetive.io/access/v1/evaluations",
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([
'subject' => [
'type' => 'agent',
'id' => 'ag_01jb8x4m2fe0bv3c7y1tq9k2rd'
],
'action' => [
'name' => 'semantik.publish'
],
'evaluations' => [
[
'resource' => [
'type' => 'Namespace',
'id' => 'ns_01jb8x4m2fe0bv3c7y1tq9k2rd'
]
],
[
'resource' => [
'type' => 'Namespace',
'id' => 'ns_01jb8x4m3ae0bv3c8m5n7r2wxz'
]
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.noetive.io/access/v1/evaluations"
payload := strings.NewReader("{\n \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\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))
}HttpResponse<String> response = Unirest.post("https://access.noetive.io/access/v1/evaluations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.noetive.io/access/v1/evaluations")
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 \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"evaluations": [
{
"decision": true,
"context": {
"tier": "allowed",
"rule_ids": [
"agent.publish"
],
"messages": []
}
},
{
"decision": false,
"context": {
"tier": "denied",
"rule_ids": [],
"messages": []
}
}
]
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}Policy checks
Ask about up to 32 actions at once
The AuthZEN batch form of evaluation. subject, action, resource
and context at the top level are defaults for every evaluation that
does not state its own. Results come back in the order asked and each
is exactly the answer evaluation would have given.
The batch is all or nothing: if any evaluation is refused (a subject
that is not the caller, a supplied principal-side entity, a malformed
part) the whole request is refused and nothing is evaluated. At most 32
evaluations; only the execute_all semantic is supported.
POST
/
access
/
v1
/
evaluations
Ask about up to 32 actions at once
curl --request POST \
--url https://access.noetive.io/access/v1/evaluations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": {
"type": "agent",
"id": "ag_01jb8x4m2fe0bv3c7y1tq9k2rd"
},
"action": {
"name": "semantik.publish"
},
"evaluations": [
{
"resource": {
"type": "Namespace",
"id": "ns_01jb8x4m2fe0bv3c7y1tq9k2rd"
}
},
{
"resource": {
"type": "Namespace",
"id": "ns_01jb8x4m3ae0bv3c8m5n7r2wxz"
}
}
]
}
'import requests
url = "https://access.noetive.io/access/v1/evaluations"
payload = {
"subject": {
"type": "agent",
"id": "ag_01jb8x4m2fe0bv3c7y1tq9k2rd"
},
"action": { "name": "semantik.publish" },
"evaluations": [{ "resource": {
"type": "Namespace",
"id": "ns_01jb8x4m2fe0bv3c7y1tq9k2rd"
} }, { "resource": {
"type": "Namespace",
"id": "ns_01jb8x4m3ae0bv3c8m5n7r2wxz"
} }]
}
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({
subject: {type: 'agent', id: 'ag_01jb8x4m2fe0bv3c7y1tq9k2rd'},
action: {name: 'semantik.publish'},
evaluations: [
{resource: {type: 'Namespace', id: 'ns_01jb8x4m2fe0bv3c7y1tq9k2rd'}},
{resource: {type: 'Namespace', id: 'ns_01jb8x4m3ae0bv3c8m5n7r2wxz'}}
]
})
};
fetch('https://access.noetive.io/access/v1/evaluations', 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://access.noetive.io/access/v1/evaluations",
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([
'subject' => [
'type' => 'agent',
'id' => 'ag_01jb8x4m2fe0bv3c7y1tq9k2rd'
],
'action' => [
'name' => 'semantik.publish'
],
'evaluations' => [
[
'resource' => [
'type' => 'Namespace',
'id' => 'ns_01jb8x4m2fe0bv3c7y1tq9k2rd'
]
],
[
'resource' => [
'type' => 'Namespace',
'id' => 'ns_01jb8x4m3ae0bv3c8m5n7r2wxz'
]
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.noetive.io/access/v1/evaluations"
payload := strings.NewReader("{\n \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\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))
}HttpResponse<String> response = Unirest.post("https://access.noetive.io/access/v1/evaluations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.noetive.io/access/v1/evaluations")
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 \"subject\": {\n \"type\": \"agent\",\n \"id\": \"ag_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n },\n \"action\": {\n \"name\": \"semantik.publish\"\n },\n \"evaluations\": [\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m2fe0bv3c7y1tq9k2rd\"\n }\n },\n {\n \"resource\": {\n \"type\": \"Namespace\",\n \"id\": \"ns_01jb8x4m3ae0bv3c8m5n7r2wxz\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"evaluations": [
{
"decision": true,
"context": {
"tier": "allowed",
"rule_ids": [
"agent.publish"
],
"messages": []
}
},
{
"decision": false,
"context": {
"tier": "denied",
"rule_ids": [],
"messages": []
}
}
]
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}{
"code": "invalid_request",
"error": "<string>"
}Authorizations
Body
application/json
Was this page helpful?

