zumpo/docs
Dashboard
Skip to content
ads / API reference
POSTcreateValueRuleSet

Create a value rule set

Creates a value rule set in the ad account and returns its id.

RULES ARE EVALUATED IN ARRAY ORDER: only the FIRST matching rule adjusts the bid for an audience that several rules would match, so the order you send is the behaviour you get. Send rules WITHOUT an id -- on a create there is nothing to keep.

THIS OPERATION IS NOT IDEMPOTENT: the same body sent twice creates TWO rule sets. No Idempotency-Key is accepted, because the contract this API tracks declares none for this resource while declaring one explicitly for other write endpoints -- the silence is a choice, not an omission. Do not auto-retry a create.

The platform enforces its own ceiling on how many rule sets an ad account may hold; this API does not pre-check it.

Authentication

The following security requirement applies to this operation.

  1. bearerhttp

    scheme
    bearer
    bearerFormat
    zumpo-api-key
Read the authentication guide

Parameters

This operation declares no path, query, header or cookie parameters.

Request body

Required body
application/json
Bodyobjectrequired
#/components/schemas/CreateAdValueRuleSetDto
additionalProperties
false
required
[ "accountId", "adAccountId", "name", "rules" ]
accountIdstringrequired

Social account id (posting or ads variant) used to resolve the platform token.

adAccountIdstringrequired

Platform ad account id (act_<n>) the value rule set is created in.

pattern
^act_[1-9]\d{0,19}$
namestringrequired
minLength
1
maxLength
255
rulesarrayrequired

The rules, IN EVALUATION ORDER -- only the FIRST matching rule adjusts the bid for an overlapping audience, so the order you send is the behaviour you get. Omit id on every rule here: on a create there is nothing to keep.

minItems
1
maxItems
10
Array itemobject
#/components/schemas/AdValueRuleDto
required
[ "name", "adjustSign", "adjustValue", "criteria" ]
idstring

The rule id, as the platform minted it. THIS FIELD IS THE MECHANISM OF THE FULL REPLACE: on an update, a rule that carries its id is KEPT, a rule without one is CREATED, and a rule you do not send at all is DELETED. Echo it back exactly as this API returned it.

maxLength
256
namestringrequired

Rule name, as it appears in the platform UI.

minLength
1
maxLength
255
adjustSignstringrequired

Which way the bid moves. THE DIRECTION LIVES HERE, not in adjustValue: there is no signed field.

enum
[ "INCREASE", "DECREASE" ]
adjustValuenumberrequired

An UNSIGNED magnitude in percent, and its ceiling DEPENDS ON adjustSign: INCREASE accepts 1-1000, DECREASE accepts 1-90. The schema maximum shown here is the INCREASE one, because a schema field cannot express a cross-field rule; a DECREASE above 90 is rejected by this API with a 400 rather than sent to be rejected by the platform. 0 is out of range in both directions.

minimum
1
maximum
1000
criteriaarrayrequired

The criteria the rule matches on. Multiple criteria within one rule are combined by the platform.

minItems
1
maxItems
4
Array itemobject
#/components/schemas/AdValueRuleCriterionDto
required
[ "criteriaType", "operator", "criteriaValues", "criteriaValueTypes" ]
criteriaTypestringrequired

What the criterion matches on. OMNI_CHANNEL (conversion location: APP, INSTANT_FORM, PHONE_CALL, WEBSITE) is accepted even though the platform's own enum table omits it -- the contract this API tracks declares it, and dropping it would reject a value the target accepts.

enum
[ "AGE", "GENDER", "OS_TYPE", "DEVICE_PLATFORM", "LOCATION", "PLACEMENT", "OMNI_CHANNEL", "AUDIENCE_LABEL" ]
operatorstringrequired

The only operator the contract declares. It is REQUIRED on every criterion even though it has a single value.

enum
[ "CONTAINS" ]
criteriaValuesarrayrequired

The values matched, in the platform's own vocabulary. AGE takes 18-24, 18+ or a custom 18-26; a range whose upper bound is 65 is invalid (use 18+). GENDER values are passed through UNTOUCHED: the platform returns them lower case on a read while a write requires upper case, so never case-compare a stored rule against a fetched one. AUDIENCE_LABEL strings are not validated anywhere -- there is no API to provision them, so a typo produces a rule that never fires.

minItems
1
Array itemstring
criteriaValueTypesarrayrequired

POSITIONALLY PAIRED with criteriaValues: entry i types value i, so the two arrays must have the SAME LENGTH. A mismatch is rejected here rather than forwarded, because the platform would silently apply its own default to the untyped values and the rule would target a different audience than the one you described.

NONE is valid for every criterion type. LOCATION additionally takes LOCATION_COUNTRY, LOCATION_REGION, LOCATION_CITY, LOCATION_COMSCORE_MARKET and they MAY be mixed inside one criterion. Values outside this set are forwarded verbatim (the platform owns the vocabulary) with ONE exception: LOCATION_DMA is rejected. LOCATION_DMA was replaced by LOCATION_COMSCORE_MARKET on 2026-06-22 and rules using DMAs are no longer active, so this API rejects it rather than storing a rule that would never fire.

minItems
1
Array itemstring
statusstring

The platform's own status text, forwarded verbatim in both directions. NO ENUM IS DECLARED for it -- the platform returns ACTIVE here but documents no value space, so this API neither normalises it nor synthesizes a default. Echo what a read returned.

maxLength
256
platformstring

Defaults to 'facebook'. Only Meta is served today.

Original schema
{
  "$ref": "#/components/schemas/CreateAdValueRuleSetDto"
}

Responses

Status codes and shapes declared for this operation. Read each description for the meaning of that response.

201Response schema
application/json
Response 201object
#/components/schemas/CreateAdValueRuleSetResponseDto
required
[ "adAccountId", "valueRuleSetId" ]
adAccountIdstringrequired

The ad account the set was created in, echoed back.

pattern
^act_[1-9]\d{0,19}$
valueRuleSetIdstringrequired

The id the platform minted. Every other operation takes it in the path.

pattern
^[1-9]\d{0,19}$
Original schema
{
  "$ref": "#/components/schemas/CreateAdValueRuleSetResponseDto"
}
400Response schema
application/json
Response 400object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
401Response schema
application/json
Response 401object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
403Response schema
application/json
Response 403object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
404Resource not found

Resource not found

application/json
Response 404object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
409Conflict

Conflict

application/json
Response 409object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
429Response schema
application/json
Response 429object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Response headers

X-RateLimit-Limit

Request ceiling that applied to this request. Authenticated requests use the team tier ceiling; unauthenticated identity endpoints use a per-IP ceiling. Usage is measured continuously against a trailing period rather than tallied and cleared at a boundary, so the full ceiling never becomes available again in one step.

X-RateLimit-Limitinteger
minimum
1
Original schema
{
  "type": "integer",
  "minimum": 1
}

X-RateLimit-Remaining

Requests still allowed against that ceiling; never negative. On a 429 produced by the request throttler this is 0. Such a refused request is not counted, so retrying too early costs you no capacity and does not push your recovery further away.

X-RateLimit-Remaininginteger
minimum
0
Original schema
{
  "type": "integer",
  "minimum": 0
}

X-RateLimit-Reset

Absolute Unix epoch time, in SECONDS, at which the current counting period turns over. This is NOT the number of seconds left: subtract the current time to obtain that. It is also NOT the moment your capacity returns: earlier usage keeps weighing on the ceiling across the turnover, so after a 429 wait for Retry-After instead, which is usually later than this value.

X-RateLimit-Resetinteger
format
int64
minimum
0
Original schema
{
  "type": "integer",
  "format": "int64",
  "minimum": 0
}

Retry-After

Seconds to wait before retrying. Always a positive integer delta (never an HTTP-date), at least 1. On a 429 from the request throttler it is the wait until your usage actually drops back under the ceiling; prefer it over any delay you compute from X-RateLimit-Reset.

Retry-Afterinteger
minimum
1
maximum
86400
Original schema
{
  "type": "integer",
  "minimum": 1,
  "maximum": 86400
}
500Server error

Server error

application/json
Response 500object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
501Response schema
application/json
Response 501object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
502Platform error

Platform error

application/json
Response 502object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
503Service unavailable

Service unavailable

application/json
Response 503object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Referenced schemas

Original local definitions used by this operation. Recursive and deeply nested references can be inspected here without expanding them repeatedly.

CreateAdValueRuleSetDto

#/components/schemas/CreateAdValueRuleSetDto

{
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Social account id (posting or ads variant) used to resolve the platform token."
    },
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "Platform ad account id (act_<n>) the value rule set is created in."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "rules": {
      "minItems": 1,
      "maxItems": 10,
      "description": "The rules, IN EVALUATION ORDER -- only the FIRST matching rule adjusts the bid for an overlapping audience, so the order you send is the behaviour you get. Omit `id` on every rule here: on a create there is nothing to keep.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdValueRuleDto"
      }
    },
    "platform": {
      "type": "string",
      "description": "Defaults to 'facebook'. Only Meta is served today."
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "adAccountId",
    "name",
    "rules"
  ]
}
AdValueRuleDto

#/components/schemas/AdValueRuleDto

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "maxLength": 256,
      "description": "The rule id, as the platform minted it. THIS FIELD IS THE MECHANISM OF THE FULL REPLACE: on an update, a rule that carries its `id` is KEPT, a rule without one is CREATED, and a rule you do not send at all is DELETED. Echo it back exactly as this API returned it."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Rule name, as it appears in the platform UI."
    },
    "adjustSign": {
      "type": "string",
      "enum": [
        "INCREASE",
        "DECREASE"
      ],
      "description": "Which way the bid moves. THE DIRECTION LIVES HERE, not in `adjustValue`: there is no signed field."
    },
    "adjustValue": {
      "type": "number",
      "minimum": 1,
      "maximum": 1000,
      "description": "An UNSIGNED magnitude in percent, and its ceiling DEPENDS ON `adjustSign`: INCREASE accepts 1-1000, DECREASE accepts 1-90. The schema maximum shown here is the INCREASE one, because a schema field cannot express a cross-field rule; a DECREASE above 90 is rejected by this API with a 400 rather than sent to be rejected by the platform. 0 is out of range in both directions."
    },
    "criteria": {
      "minItems": 1,
      "maxItems": 4,
      "description": "The criteria the rule matches on. Multiple criteria within one rule are combined by the platform.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdValueRuleCriterionDto"
      }
    },
    "status": {
      "type": "string",
      "maxLength": 256,
      "description": "The platform's own status text, forwarded verbatim in both directions. NO ENUM IS DECLARED for it -- the platform returns ACTIVE here but documents no value space, so this API neither normalises it nor synthesizes a default. Echo what a read returned."
    }
  },
  "required": [
    "name",
    "adjustSign",
    "adjustValue",
    "criteria"
  ]
}
AdValueRuleCriterionDto

#/components/schemas/AdValueRuleCriterionDto

{
  "type": "object",
  "properties": {
    "criteriaType": {
      "type": "string",
      "enum": [
        "AGE",
        "GENDER",
        "OS_TYPE",
        "DEVICE_PLATFORM",
        "LOCATION",
        "PLACEMENT",
        "OMNI_CHANNEL",
        "AUDIENCE_LABEL"
      ],
      "description": "What the criterion matches on. `OMNI_CHANNEL` (conversion location: APP, INSTANT_FORM, PHONE_CALL, WEBSITE) is accepted even though the platform's own enum table omits it -- the contract this API tracks declares it, and dropping it would reject a value the target accepts."
    },
    "operator": {
      "type": "string",
      "enum": [
        "CONTAINS"
      ],
      "description": "The only operator the contract declares. It is REQUIRED on every criterion even though it has a single value."
    },
    "criteriaValues": {
      "minItems": 1,
      "description": "The values matched, in the platform's own vocabulary. AGE takes `18-24`, `18+` or a custom `18-26`; a range whose upper bound is 65 is invalid (use `18+`). GENDER values are passed through UNTOUCHED: the platform returns them lower case on a read while a write requires upper case, so never case-compare a stored rule against a fetched one. AUDIENCE_LABEL strings are not validated anywhere -- there is no API to provision them, so a typo produces a rule that never fires.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "criteriaValueTypes": {
      "minItems": 1,
      "description": "POSITIONALLY PAIRED with `criteriaValues`: entry i types value i, so the two arrays must have the SAME LENGTH. A mismatch is rejected here rather than forwarded, because the platform would silently apply its own default to the untyped values and the rule would target a different audience than the one you described.\n\n`NONE` is valid for every criterion type. LOCATION additionally takes LOCATION_COUNTRY, LOCATION_REGION, LOCATION_CITY, LOCATION_COMSCORE_MARKET and they MAY be mixed inside one criterion. Values outside this set are forwarded verbatim (the platform owns the vocabulary) with ONE exception: LOCATION_DMA is rejected. LOCATION_DMA was replaced by LOCATION_COMSCORE_MARKET on 2026-06-22 and rules using DMAs are no longer active, so this API rejects it rather than storing a rule that would never fire.",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "criteriaType",
    "operator",
    "criteriaValues",
    "criteriaValueTypes"
  ]
}
CreateAdValueRuleSetResponseDto

#/components/schemas/CreateAdValueRuleSetResponseDto

{
  "type": "object",
  "properties": {
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "The ad account the set was created in, echoed back."
    },
    "valueRuleSetId": {
      "type": "string",
      "pattern": "^[1-9]\\d{0,19}$",
      "description": "The id the platform minted. Every other operation takes it in the path."
    }
  },
  "required": [
    "adAccountId",
    "valueRuleSetId"
  ]
}
ZumpoErrorDto

#/components/schemas/ZumpoErrorDto

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable message. UNSTABLE — do not branch on it.",
      "example": "WhatsApp session window expired; use a template message."
    },
    "type": {
      "type": "string",
      "description": "Stable error category (does not change across versions).",
      "enum": [
        "invalid_request_error",
        "authentication_error",
        "permission_error",
        "not_found",
        "conflict",
        "rate_limit_error",
        "platform_error",
        "platform_rejected",
        "account_disconnected",
        "media_error",
        "api_error"
      ],
      "example": "invalid_request_error"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code.",
      "example": "whatsapp_window_expired"
    },
    "param": {
      "type": "string",
      "description": "Offending parameter, present only when relevant.",
      "example": "body"
    },
    "docUrl": {
      "type": "string",
      "description": "https://docs.zumpo.io/errors/{code}",
      "example": "https://docs.zumpo.io/errors/whatsapp_window_expired"
    },
    "requestId": {
      "type": "string",
      "description": "Support correlation id: req_ + 16 hex.",
      "example": "req_7f3a9c2e1b8d4056"
    },
    "details": {
      "type": "object",
      "additionalProperties": true,
      "description": "Additional structured context, present only when an error has more to say than a single `param` can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.",
      "example": {
        "created": [
          {
            "kind": "campaign",
            "platformId": "120210000000000001"
          },
          {
            "kind": "adSet",
            "platformId": "120210000000000002"
          }
        ]
      }
    }
  },
  "required": [
    "error",
    "type",
    "code",
    "docUrl",
    "requestId"
  ]
}