curl --request POST \
--url https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"includeWallets": true
}
'import requests
url = "https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy"
payload = {
"prompt": "<string>",
"includeWallets": 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({prompt: '<string>', includeWallets: true})
};
fetch('https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy', 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}/business-policies/generate-policy",
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([
'prompt' => '<string>',
'includeWallets' => true
]),
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}/business-policies/generate-policy"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"includeWallets\": 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))
}HttpResponse<String> response = Unirest.post("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"includeWallets\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy")
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 \"prompt\": \"<string>\",\n \"includeWallets\": true\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"realmId": "<string>",
"organizationId": "<string>",
"context": "PAYMENT",
"name": "<string>",
"order": 123,
"status": "ACTIVE",
"actions": {
"hierarchy": true,
"autoAction": "APPROVE",
"moveBalance": {
"addBalance": true,
"fromAccountId": "<string>",
"fromWalletId": "<string>"
},
"approvals": [
{
"type": "USER",
"id": "<string>",
"name": "<string>"
}
]
},
"conditions": {
"logic": "AND",
"groups": [
{
"logic": "AND",
"items": [
{
"operator": "<string>",
"field": "<string>",
"maskType": "<string>",
"dynamicFieldValue": "<string>",
"value": "<unknown>"
}
],
"dependsOn": [
"<string>"
]
}
]
},
"description": "<string>"
},
"unsupported": [
"<string>"
]
}/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy
curl --request POST \
--url https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"includeWallets": true
}
'import requests
url = "https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy"
payload = {
"prompt": "<string>",
"includeWallets": 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({prompt: '<string>', includeWallets: true})
};
fetch('https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy', 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}/business-policies/generate-policy",
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([
'prompt' => '<string>',
'includeWallets' => true
]),
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}/business-policies/generate-policy"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"includeWallets\": 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))
}HttpResponse<String> response = Unirest.post("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"includeWallets\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ruleengine.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/business-policies/generate-policy")
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 \"prompt\": \"<string>\",\n \"includeWallets\": true\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"realmId": "<string>",
"organizationId": "<string>",
"context": "PAYMENT",
"name": "<string>",
"order": 123,
"status": "ACTIVE",
"actions": {
"hierarchy": true,
"autoAction": "APPROVE",
"moveBalance": {
"addBalance": true,
"fromAccountId": "<string>",
"fromWalletId": "<string>"
},
"approvals": [
{
"type": "USER",
"id": "<string>",
"name": "<string>"
}
]
},
"conditions": {
"logic": "AND",
"groups": [
{
"logic": "AND",
"items": [
{
"operator": "<string>",
"field": "<string>",
"maskType": "<string>",
"dynamicFieldValue": "<string>",
"value": "<unknown>"
}
],
"dependsOn": [
"<string>"
]
}
]
},
"description": "<string>"
},
"unsupported": [
"<string>"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
Successful response
POST .../business-policies/generate-policy response.
policy is create-compatible: submit it to POST .../business-policies as it stands, minus actions.approvals[].name (the create route rejects that, exactly as it does on edit).
POST .../business-policies/generate-policy response — a DRAFT policy. It is NOT persisted and has no id: submit it through the create route to save it (stripping actions.approvals[].name, which the create route rejects, exactly as the edit flow already does).
Show child attributes
Show child attributes
Restrictions the request asked for that this policy does NOT express — for example a wallet whose id was not supplied. Empty when everything was captured.
Always show these before the draft is saved: the policy is otherwise valid and will govern MORE payments than the request described.