Call it
curl https://api.peume.com/v1/call/create-an-ad-rule \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"name": "your name",
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"level": "your level",
"conditions": "your conditions",
"actions": "your actions"
}
}'const res = await fetch("https://api.peume.com/v1/call/create-an-ad-rule", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"name": "your name",
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"level": "your level",
"conditions": "your conditions",
"actions": "your actions"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/create-an-ad-rule",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"name": "your name",
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"level": "your level",
"conditions": "your conditions",
"actions": "your actions"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: create-an-ad-rule.
Parameters
nameRequiredstringaccountIdRequiredstringThe ads connection (account ID from `GET /v1/accounts`).
adAccountIdRequiredstringPlatform ad account ID, from `GET /v1/ads/accounts`.
levelRequiredobjectlevel
campaignIdsarrayOnly check these platform campaign IDs (or what sits in them). Leave out or send null to check the whole ad account.
filtersobjectfilters
groupsobjectgroups
lifecyclestringLeave out or send null for none.
conditionsRequiredobjectconditions
actionsRequiredobjectactions
schedulestringLeave it out to run every 60 minutes.
cooldownMinutesintegerHow long the rule leaves an object alone after acting on it.
Example: 1440
enabledbooleanExample: true
