Update an ad rule
Changes any field of a rule except its connection and ad account. Send campaignIds: null to
check the whole ad account again. Changing the schedule, or enabling a disabled rule, moves the
next run; re-sending enabled: true on an enabled rule does not.
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adrules.updateAdRule({ body: { name: 'Example', level: 'campaign', campaignIds: {}, },});console.log(data);{ "rule": { "id": "string", "name": "string", "accountId": "string", "platform": "string", "adAccountId": "string", "level": "campaign", "campaignIds": [ "string" ], "conditions": { "all": [ { "metric": "spend", "window": "today", "op": ">", "value": 0 } ] }, "actions": [ { "type": "notify" } ], "schedule": { "everyMinutes": 60 }, "cooldownMinutes": 0, "enabled": true, "lastRunAt": "2019-08-24T14:15:22Z", "nextRunAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}