curl --request POST \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run \
--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",
"limit": 25,
"cursor": 1,
"account_id": 2,
"workspace_id": 2
}
'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run"
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",
"limit": 25,
"cursor": 1,
"account_id": 2,
"workspace_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',
limit: 25,
cursor: 1,
account_id: 2,
workspace_id: 2
})
};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run', 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/dry-run",
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',
'limit' => 25,
'cursor' => 1,
'account_id' => 2,
'workspace_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/dry-run"
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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_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/dry-run")
.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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run")
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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"dry_run": {
"actions": [
{
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"status": "evaluated",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"would_auto_execute": true,
"diff": {
"before": "<unknown>",
"proposed": "<unknown>"
}
}
],
"next_cursor": 123,
"truncated": true,
"continuation": "<string>",
"total": 123
}
}{
"error": "invalid_token",
"error_description": "<string>"
}{
"error": "invalid_token",
"error_description": "<string>"
}{
"error": {
"code": "api_route_not_found",
"message": "<string>",
"resolution": "<string>"
},
"request": {
"method": "<string>",
"path": "<string>"
},
"resources": {
"documentation": "<string>",
"openapi": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Preview actions
Preview policy decisions and execution diffs for the approved account without saving a proposal. A kill switch returns blocked policy decisions.
curl --request POST \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run \
--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",
"limit": 25,
"cursor": 1,
"account_id": 2,
"workspace_id": 2
}
'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run"
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",
"limit": 25,
"cursor": 1,
"account_id": 2,
"workspace_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',
limit: 25,
cursor: 1,
account_id: 2,
workspace_id: 2
})
};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run', 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/dry-run",
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',
'limit' => 25,
'cursor' => 1,
'account_id' => 2,
'workspace_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/dry-run"
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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_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/dry-run")
.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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/actions/dry-run")
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 \"limit\": 25,\n \"cursor\": 1,\n \"account_id\": 2,\n \"workspace_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"dry_run": {
"actions": [
{
"type": "increase_budget",
"target_entity": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"status": "evaluated",
"policy_decision": "allow",
"policy_reasons": [
"<string>"
],
"approval_required": true,
"would_auto_execute": true,
"diff": {
"before": "<unknown>",
"proposed": "<unknown>"
}
}
],
"next_cursor": 123,
"truncated": true,
"continuation": "<string>",
"total": 123
}
}{
"error": "invalid_token",
"error_description": "<string>"
}{
"error": "invalid_token",
"error_description": "<string>"
}{
"error": {
"code": "api_route_not_found",
"message": "<string>",
"resolution": "<string>"
},
"request": {
"method": "<string>",
"path": "<string>"
},
"resources": {
"documentation": "<string>",
"openapi": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Workspace key with read-actions for reads or propose-actions for writes. Optional positive account ID. A bound key may name only its own account; a different ID returns 422. An unbound key requires exactly one active available advertising account with an active connection; omission uses that account and a supplied ID must match it. Multiple active accounts return 422 even when account_id is supplied.
Body
Response
Evaluated dry-run preview. Result projections share the 80,000-byte MCP JSON budget; defaults are bounded, next_cursor continues complete rows, and oversized single rows are explicitly refused. Plan creative continuation uses the read endpoint; proposal continuation uses the batch read endpoint.