Propose actions
curl --request POST \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"type": "increase_budget",
"target_entity": {
"id": "<string>",
"name": "<string>"
},
"params": {
"new_daily_budget_minor": 2
},
"rationale": "<string>",
"idempotency_key": "<string>"
}
],
"rationale": "<string>",
"idempotency_key": "<string>",
"evidence": [
{
"fields_used": [
"<string>"
],
"action_index": 1
}
],
"target_source": "human_supplied",
"account_id": 2
}
'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions"
payload = {
"actions": [
{
"type": "increase_budget",
"target_entity": {
"id": "<string>",
"name": "<string>"
},
"params": { "new_daily_budget_minor": 2 },
"rationale": "<string>",
"idempotency_key": "<string>"
}
],
"rationale": "<string>",
"idempotency_key": "<string>",
"evidence": [
{
"fields_used": ["<string>"],
"action_index": 1
}
],
"target_source": "human_supplied",
"account_id": 2
}
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({
actions: [
{
type: 'increase_budget',
target_entity: {id: '<string>', name: '<string>'},
params: {new_daily_budget_minor: 2},
rationale: '<string>',
idempotency_key: '<string>'
}
],
rationale: '<string>',
idempotency_key: '<string>',
evidence: [{fields_used: ['<string>'], action_index: 1}],
target_source: 'human_supplied',
account_id: 2
})
};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions', 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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions",
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([
'actions' => [
[
'type' => 'increase_budget',
'target_entity' => [
'id' => '<string>',
'name' => '<string>'
],
'params' => [
'new_daily_budget_minor' => 2
],
'rationale' => '<string>',
'idempotency_key' => '<string>'
]
],
'rationale' => '<string>',
'idempotency_key' => '<string>',
'evidence' => [
[
'fields_used' => [
'<string>'
],
'action_index' => 1
]
],
'target_source' => 'human_supplied',
'account_id' => 2
]),
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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions")
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 \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"proposal": {
"id": "<string>",
"scope": "<unknown>",
"evidence_provenance": "<unknown>",
"status": "pending",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"inbox_url": "<string>",
"approval_queue_url": "<string>",
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"actions": [
{
"id": "<string>",
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"params": {},
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"policy_evidence": "<unknown>"
}
]
}
}{
"proposal": {
"id": "<string>",
"scope": "<unknown>",
"evidence_provenance": "<unknown>",
"status": "pending",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"inbox_url": "<string>",
"approval_queue_url": "<string>",
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"actions": [
{
"id": "<string>",
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"params": {},
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"policy_evidence": "<unknown>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Actions
Propose actions
Submit a governed proposal for an advertising account available to this workspace key. A matching idempotency key returns the saved batch.
POST
/
agent
/
workspaces
/
{workspace}
/
actions
Propose actions
curl --request POST \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"type": "increase_budget",
"target_entity": {
"id": "<string>",
"name": "<string>"
},
"params": {
"new_daily_budget_minor": 2
},
"rationale": "<string>",
"idempotency_key": "<string>"
}
],
"rationale": "<string>",
"idempotency_key": "<string>",
"evidence": [
{
"fields_used": [
"<string>"
],
"action_index": 1
}
],
"target_source": "human_supplied",
"account_id": 2
}
'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions"
payload = {
"actions": [
{
"type": "increase_budget",
"target_entity": {
"id": "<string>",
"name": "<string>"
},
"params": { "new_daily_budget_minor": 2 },
"rationale": "<string>",
"idempotency_key": "<string>"
}
],
"rationale": "<string>",
"idempotency_key": "<string>",
"evidence": [
{
"fields_used": ["<string>"],
"action_index": 1
}
],
"target_source": "human_supplied",
"account_id": 2
}
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({
actions: [
{
type: 'increase_budget',
target_entity: {id: '<string>', name: '<string>'},
params: {new_daily_budget_minor: 2},
rationale: '<string>',
idempotency_key: '<string>'
}
],
rationale: '<string>',
idempotency_key: '<string>',
evidence: [{fields_used: ['<string>'], action_index: 1}],
target_source: 'human_supplied',
account_id: 2
})
};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions', 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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions",
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([
'actions' => [
[
'type' => 'increase_budget',
'target_entity' => [
'id' => '<string>',
'name' => '<string>'
],
'params' => [
'new_daily_budget_minor' => 2
],
'rationale' => '<string>',
'idempotency_key' => '<string>'
]
],
'rationale' => '<string>',
'idempotency_key' => '<string>',
'evidence' => [
[
'fields_used' => [
'<string>'
],
'action_index' => 1
]
],
'target_source' => 'human_supplied',
'account_id' => 2
]),
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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\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://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions")
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 \"actions\": [\n {\n \"type\": \"increase_budget\",\n \"target_entity\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"params\": {\n \"new_daily_budget_minor\": 2\n },\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"evidence\": [\n {\n \"fields_used\": [\n \"<string>\"\n ],\n \"action_index\": 1\n }\n ],\n \"target_source\": \"human_supplied\",\n \"account_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"proposal": {
"id": "<string>",
"scope": "<unknown>",
"evidence_provenance": "<unknown>",
"status": "pending",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"inbox_url": "<string>",
"approval_queue_url": "<string>",
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"actions": [
{
"id": "<string>",
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"params": {},
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"policy_evidence": "<unknown>"
}
]
}
}{
"proposal": {
"id": "<string>",
"scope": "<unknown>",
"evidence_provenance": "<unknown>",
"status": "pending",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"inbox_url": "<string>",
"approval_queue_url": "<string>",
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"actions": [
{
"id": "<string>",
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"params": {},
"rationale": "<string>",
"proposed_by": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"policy_evidence": "<unknown>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Workspace execution key with the propose-actions grant. Unbound keys select an available advertising account with account_id.
Path Parameters
The workspace ID
Body
application/json
Required array length:
1 - 25 elements- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
Show child attributes
Show child attributes
Maximum string length:
4000Maximum string length:
64Required array length:
1 - 3 elementsShow child attributes
Show child attributes
Available options:
human_supplied Required range:
x >= 1Response
Saved idempotent proposal.
Show child attributes
Show child attributes