Replace a value rule set
THIS IS A FULL REPLACE, NOT A PATCH. Meta's update is declarative: the body you send becomes the rule set.
GET /v1/ads/value-rule-sets/{valueRuleSetId}FIRST.- Keep a rule or criterion by echoing its
id. - Create one by including the object WITHOUT an
id. - Delete one by OMITTING it from the array. There is no warning and no undo.
name and rules are both required for exactly this reason: a partial body would
silently destroy every rule left out.
Rule order is semantic: the array order you send is the evaluation order, and only the first matching rule adjusts the bid for an overlapping audience.
Existing rule sets created elsewhere may contain LOCATION_DMA criteria. Those went
inert on 2026-06-22 and are rejected here; migrate them to LOCATION_COMSCORE_MARKET.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Platform value rule set id.
Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
Required: the update replaces the whole set.
1 <= length <= 255The COMPLETE rule list. Omitting a rule deletes it on Meta.
1 <= items <= 10Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adaccounts.updateValueRuleSet({ path: { valueRuleSetId: 'valueruleset_abc123', }, body: { accountId: 'account_abc123', name: 'Example', rules: [ { name: 'Example', adjustSign: 'INCREASE', adjustValue: 1, criteria: [ { criteriaType: 'AGE', operator: 'CONTAINS', criteriaValues: [ 'string', ], criteriaValueTypes: [ 'string', ], }, ], }, ], },});console.log(data);{
"valueRuleSetId": "string",
"name": "string",
"rules": [
{
"id": "string",
"name": "string",
"adjustSign": "INCREASE",
"adjustValue": 1,
"status": "string",
"criteria": [
{
"id": "string",
"criteriaType": "AGE",
"operator": "CONTAINS",
"criteriaValues": [
"string"
],
"criteriaValueTypes": [
"string"
]
}
]
}
],
"message": "string"
}{
"error": "Unauthorized"
}Update ad account settings PATCH
Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26). Set them once and every EU-targeted call to `/v1/ads/create`, `/v1/ads/boost` and `/v1/ads/ctwa` on that ad account can omit `dsaBeneficiary`/`dsaPayor`: Meta applies the defaults automatically. The values are written to the ad account on Meta, the same setting Ads Manager edits. Nothing is stored in Zernio, and defaults already set in Ads Manager work identically. Zernio never guesses these values for you. Beneficiary and payor are legal disclosures shown to EU users, so you must provide the entity names explicitly. Use `GET /v1/ads/dsa-recommendations` to offer suggestions in your UI. If `defaultDsaPayor` is omitted, the beneficiary is also set as the payor, which covers the common case where the same entity benefits from and pays for the ads. Read the current values back with `GET /v1/ads/dsa-defaults`. Currently supported for Meta accounts only; other platforms return 400.
Delete a value rule set DELETE
Deletes the rule set (Meta's `POST /{value-rule-set-id}/delete_rule_set`, a custom action edge rather than an HTTP DELETE on its side). Ad sets pointing at it are not modified here; detach them first with `valueRulesApplied: false` on `PUT /v1/ads/ad-sets/{adSetId}`.