Get an action rule
curl --request GET \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule} \
--header 'Authorization: Bearer <token>'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}', 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}/action-rules/{action_rule}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rule": {
"id": "<string>",
"workspace_id": 123,
"platform_ad_account_id": 123,
"name": "<string>",
"enabled": true,
"suspended_at": "2023-11-07T05:31:56Z",
"suspended_reason": "<string>",
"window": {
"days": 3,
"kind": "last_complete_days",
"timezone": "<string>"
},
"current_revision": {
"id": "<string>",
"target_level": "ad",
"action": "pause",
"budget_change_percent": 123,
"minimum_counted_arrivals": 123,
"cost_comparison": "at_least",
"cost_ratio": "<string>",
"author_type": "user",
"created_at": "2023-11-07T05:31:56Z"
},
"revisions": [
{
"id": "<string>",
"target_level": "ad",
"action": "pause",
"budget_change_percent": 123,
"minimum_counted_arrivals": 123,
"cost_comparison": "at_least",
"cost_ratio": "<string>",
"author_type": "user",
"created_at": "2023-11-07T05:31:56Z"
}
],
"runs": [
{
"id": "<string>",
"revision_id": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"window_end": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"status": "<string>",
"reason": "<string>",
"account_spend_minor": "<string>",
"account_counted_arrivals": 123,
"evaluated_at": "2023-11-07T05:31:56Z",
"decisions": [
{
"id": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"target_name": "<string>",
"target_spend_minor": "<string>",
"target_counted_arrivals": 123,
"decision": "<string>",
"reason": "<string>",
"action_type": "<string>",
"new_daily_budget_minor": 123,
"action_batch_id": "<string>"
}
],
"decisions_truncated": true
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"error": {
"code": "api_route_not_found",
"message": "<string>",
"resolution": "<string>"
},
"request": {
"method": "<string>",
"path": "<string>"
},
"resources": {
"documentation": "<string>",
"openapi": "<string>"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Actions
Get an action rule
Read the account-scoped rule, immutable revisions and recent run decisions. Send Accept: application/json for the documented JSON errors.
GET
/
agent
/
workspaces
/
{workspace}
/
action-rules
/
{action_rule}
Get an action rule
curl --request GET \
--url https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule} \
--header 'Authorization: Bearer <token>'import requests
url = "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}', 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}/action-rules/{action_rule}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://plainrouter.com/api/v1/agent/workspaces/{workspace}/action-rules/{action_rule}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rule": {
"id": "<string>",
"workspace_id": 123,
"platform_ad_account_id": 123,
"name": "<string>",
"enabled": true,
"suspended_at": "2023-11-07T05:31:56Z",
"suspended_reason": "<string>",
"window": {
"days": 3,
"kind": "last_complete_days",
"timezone": "<string>"
},
"current_revision": {
"id": "<string>",
"target_level": "ad",
"action": "pause",
"budget_change_percent": 123,
"minimum_counted_arrivals": 123,
"cost_comparison": "at_least",
"cost_ratio": "<string>",
"author_type": "user",
"created_at": "2023-11-07T05:31:56Z"
},
"revisions": [
{
"id": "<string>",
"target_level": "ad",
"action": "pause",
"budget_change_percent": 123,
"minimum_counted_arrivals": 123,
"cost_comparison": "at_least",
"cost_ratio": "<string>",
"author_type": "user",
"created_at": "2023-11-07T05:31:56Z"
}
],
"runs": [
{
"id": "<string>",
"revision_id": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"window_end": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"status": "<string>",
"reason": "<string>",
"account_spend_minor": "<string>",
"account_counted_arrivals": 123,
"evaluated_at": "2023-11-07T05:31:56Z",
"decisions": [
{
"id": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"target_name": "<string>",
"target_spend_minor": "<string>",
"target_counted_arrivals": 123,
"decision": "<string>",
"reason": "<string>",
"action_type": "<string>",
"new_daily_budget_minor": 123,
"action_batch_id": "<string>"
}
],
"decisions_truncated": true
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"error": {
"code": "api_route_not_found",
"message": "<string>",
"resolution": "<string>"
},
"request": {
"method": "<string>",
"path": "<string>"
},
"resources": {
"documentation": "<string>",
"openapi": "<string>"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
A workspace-scoped key with read ability and actions.rules.index or actions.rules.show access to the bound account. Send Accept: application/json.
Query Parameters
Optional account ID, ignored by an account-bound key. 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.
Required range:
x >= 1Response
Rule with revisions and recent runs.
Show child attributes
Show child attributes