Automated Rules
Preview an ad rule
Evaluates a rule against current metrics and returns what it would match right now, without acting on anything, sending a webhook or starting a cooldown. Works on disabled rules.
PlatformsMetaGoogleTikTokLinkedInPinterestX
Authorization
bearerAuth AuthorizationBearer <token>
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Path Parameters
ruleId*string
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.previewAdRule({ path: { ruleId: 'rule_abc123', },});console.log(data);{ "evaluatedAt": "2019-08-24T14:15:22Z", "today": "2019-08-24", "timezone": "string", "timezoneAssumed": true, "currency": "string", "matched": 0, "objects": [ { "id": "string", "name": "string", "campaignId": "string", "matched": true, "conditions": [ { "metric": "spend", "window": "today", "op": ">", "value": 0, "actual": 0, "met": true } ] } ]}Was this page helpful?