/realms/{realmId}/organizations/{organizationId}/policy-request
curl --request POST \
--url https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {}
}
'import requests
url = "https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request"
payload = {
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {}
}
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({
accountId: '<string>',
walletId: '<string>',
subjectType: '<string>',
subjectId: '<string>',
requester: {userId: '<string>', name: '<string>', email: '<string>'},
body: JSON.stringify({})
})
};
fetch('https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request', 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.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request",
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([
'accountId' => '<string>',
'walletId' => '<string>',
'subjectType' => '<string>',
'subjectId' => '<string>',
'requester' => [
'userId' => '<string>',
'name' => '<string>',
'email' => '<string>'
],
'body' => [
]
]),
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://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\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://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request")
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 \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"realmId": "<string>",
"organizationId": "<string>",
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {},
"policyId": "<string>",
"approvalDeadline": "<string>",
"approvalHierarchy": true,
"approvals": [
{
"id": "<string>",
"name": "<string>",
"users": [
{
"userId": "<string>",
"userName": "<string>",
"userEmail": "<string>"
}
],
"createdAt": "<string>",
"requestedAt": "<string>",
"decisionAt": "<string>"
}
],
"executionFailReason": "<string>",
"executionMoveBalance": {
"addBalance": true,
"fromAccountId": "<string>",
"fromWalletId": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}Policy Request
/realms/{realmId}/organizations/{organizationId}/policy-request
POST
/
realms
/
{realmId}
/
organizations
/
{organizationId}
/
policy-request
/realms/{realmId}/organizations/{organizationId}/policy-request
curl --request POST \
--url https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {}
}
'import requests
url = "https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request"
payload = {
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {}
}
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({
accountId: '<string>',
walletId: '<string>',
subjectType: '<string>',
subjectId: '<string>',
requester: {userId: '<string>', name: '<string>', email: '<string>'},
body: JSON.stringify({})
})
};
fetch('https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request', 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.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request",
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([
'accountId' => '<string>',
'walletId' => '<string>',
'subjectType' => '<string>',
'subjectId' => '<string>',
'requester' => [
'userId' => '<string>',
'name' => '<string>',
'email' => '<string>'
],
'body' => [
]
]),
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://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\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://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/policy-request")
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 \"accountId\": \"<string>\",\n \"walletId\": \"<string>\",\n \"subjectType\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"requester\": {\n \"userId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"body\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"realmId": "<string>",
"organizationId": "<string>",
"accountId": "<string>",
"walletId": "<string>",
"subjectType": "<string>",
"subjectId": "<string>",
"requester": {
"userId": "<string>",
"name": "<string>",
"email": "<string>"
},
"body": {},
"policyId": "<string>",
"approvalDeadline": "<string>",
"approvalHierarchy": true,
"approvals": [
{
"id": "<string>",
"name": "<string>",
"users": [
{
"userId": "<string>",
"userName": "<string>",
"userEmail": "<string>"
}
],
"createdAt": "<string>",
"requestedAt": "<string>",
"decisionAt": "<string>"
}
],
"executionFailReason": "<string>",
"executionMoveBalance": {
"addBalance": true,
"fromAccountId": "<string>",
"fromWalletId": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
PAYMENT, SPEND_REVIEW, TRAVEL Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
201 - application/json
Successful response
Kept from the request payload so the subject can be fulfilled later.
The business surface a policy governs.
Available options:
PAYMENT, SPEND_REVIEW, TRAVEL Show child attributes
Show child attributes
Full subject entity snapshot.
Show child attributes
Show child attributes
The matched business policy.
Root lifecycle: REQUESTED → APPROVED | DENIED | CANCELED | EXPIRED (terminal).
Available options:
REQUESTED, APPROVED, DENIED, CANCELED, EXPIRED Runs only after the root reaches APPROVED.
Available options:
WAITING, PROCESSING, EXECUTED, FAILED createdAt + policy.actions.approvalDeadlineHours (default 72h).
Copied from policy.actions.hierarchy.
Show child attributes
Show child attributes
Copied from the matched policy at creation.
Show child attributes
Show child attributes
⌘I