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

Create a Reach & Frequency prediction

Creates a reach and frequency prediction -- a QUOTE. NOTHING IS BOUGHT here and no ad entities are created; the money-binding verb is POST /v1/ads/rf-predictions/{predictionId}/reserve.

SEND EXACTLY ONE of budgetAmount / reach. They ask opposite questions: send budgetAmount and the platform predicts the REACH, send reach and it predicts the BUDGET. Both, or neither, is a 400 -- and the two cases carry DIFFERENT codes (ambiguous_prediction_basis and missing_prediction_basis), because they are different mistakes with different fixes.

THE WINDOW MAY SPAN AT MOST EIGHT WEEKS (56 days) and endDate must be after startDate; both are checked before the request leaves this API. The rule that startDate be in the future is NOT checked here -- "future" depends on a clock this API does not share with the platform, so a borderline window is left for the platform to accept or refuse.

MONEY IS FORWARDED UNCONVERTED, IN BOTH DIRECTIONS. budgetAmount goes to the platform exactly as you send it and the platform reads it in the MINOR unit of the ad account currency (cents for USD); the quoted budget, minBudget and maxBudget come back in that same minor unit. This request carries no currency field, so this API cannot convert whole units for you -- and it does not guess, because the divisor is currency dependent (JPY, KRW and CLP have no minor unit).

THIS OPERATION IS NOT IDEMPOTENT: the same body sent twice leaves TWO predictions on the platform. 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.

Only served for Meta today. An account whose adapter does not implement reach and frequency answers 501 -- the request is valid, the capability is what is missing.

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/CreateRfPredictionDto
additionalProperties
false
required
[ "accountId", "adAccountId", "startDate", "endDate" ]
accountIdstringrequired

Social account id used to resolve the platform token.

adAccountIdstringrequired

Meta ad account id (act_<n>) the prediction is quoted on.

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

Lifetime budget for the window, and sending it means THE PLATFORM PREDICTS THE REACH. EXACTLY ONE of budgetAmount / reach is required; both, or neither, is a 400 with its own code.

THE VALUE IS FORWARDED UNCHANGED and the platform reads it in the MINOR unit of the ad account currency -- cents for USD. This request carries no currency field, so this API cannot convert whole units for you and does not try: send the minor-unit amount.

reachnumber

Target unique reach, and sending it means THE PLATFORM PREDICTS THE BUDGET. EXACTLY ONE of budgetAmount / reach is required.

startDatestringrequired

Campaign window start. The platform requires it to be in the future; that check is NOT made here, because "future" depends on a clock this API does not share with the platform, and rejecting a borderline window locally would cost you one the platform would have accepted.

format
date-time
endDatestringrequired

Campaign window end. It must be after startDate, and the window may span at most 56 days (eight weeks) -- that limit is the platform's and is enforced before the request leaves this API.

format
date-time
frequencyCapnumber

Max impressions per person over the window. THE BOUNDS ARE THIS API'S, not measurably the platform's: the vendor documents the field as a plain integer with no stated range, so a value outside 1..90 is refused here even if the platform might have taken it.

minimum
1
maximum
90
targetingobject

Canonical camelCase targeting spec. It is TRANSLATED to the platform's own snake_case targeting object by the same translator the reach-estimate endpoint uses, so only the canonical keys are accepted; an unknown key is refused here rather than forwarded, because the platform would otherwise drop it silently and quote an untargeted reach.

THERE IS NO DEFAULT. Omit it and this API sends no targeting at all, leaving the platform's own default in force; it does not substitute one of its own.

placementsobject

Placements object. A TOP-LEVEL placements WINS over a placements key nested inside targeting; when neither is set, no placement fields are sent and the platform's own default applies. Reservation campaigns reject automatic placements, and that rejection comes from the platform -- this API does not pre-empt it, because the wire shape of "automatic" was never measured.

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

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/RfPredictionEnvelopeDto
required
[ "adAccountId", "currency", "prediction" ]
adAccountIdstringrequired

The ad account the prediction belongs to, echoed back from your request. It is NOT read out of the platform response: the node does not carry it, and deriving it would mean publishing a value that was never observed.

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

The ad account currency the money fields are denominated in, as the platform reported it. null when the platform did not report one -- this API does not fall back to a default, because a wrong currency would silently mis-scale every amount above.

nullable
true
predictionobjectrequired
#/components/schemas/RfPredictionDto
required
[ "predictionId", "status", "budget", "reach", "impressions", "minBudget", "maxBudget", "minReach", "maxReach", "frequencyCap", "startTime", "stopTime", "expiresAt" ]
predictionIdstringrequired

The platform's own prediction id. AFTER A RESERVE THIS IS A NEW id, not the one you reserved: reserving mints a fresh object. It is the RESERVED id that belongs on POST /v1/ads/create and on the DELETE that releases it.

pattern
^[1-9]\d{0,20}$
statusnumberrequired

The platform's own numeric prediction status, forwarded AS IS. THIS API PUBLISHES NO NAMES FOR IT: the vendor documents the field only as an unsigned integer and never states what each value means, so any mapping here would be invented. Treat the number as opaque and poll GET /v1/ads/rf-predictions/{predictionId} until it stops changing.

budgetnumberrequired

Quoted (or provided) lifetime budget for the window, in the MINOR unit of currency -- cents for USD -- exactly as the platform reported it. THIS API DOES NOT CONVERT: the divisor depends on the currency (JPY, KRW and CLP have no minor unit at all), so a fixed divide-by-100 would be wrong for them. null means the platform did not report a number, which is not the same fact as zero.

nullable
true
reachnumberrequired

Predicted (or requested) unique reach. null when unreported.

nullable
true
impressionsnumberrequired

Predicted impressions over the window. null when unreported.

nullable
true
minBudgetnumberrequired

The platform's allowed LOWER bound for this spec, in the MINOR unit of currency, unconverted. null when unreported.

nullable
true
maxBudgetnumberrequired

The platform's allowed UPPER bound for this spec, in the MINOR unit of currency, unconverted. null when unreported.

nullable
true
minReachnumberrequired

The platform's allowed lower bound on reach.

nullable
true
maxReachnumberrequired

The platform's allowed upper bound on reach.

nullable
true
frequencyCapnumberrequired

Max impressions per person over the window, echoed by the platform. null when you did not send one and the platform did not report one -- this API does not substitute the platform's own default, because that default was never measured.

nullable
true
startTimenumberrequired

Reserved window start as Unix SECONDS. The platform may report this as an ISO-8601 timestamp instead; either form is normalised to seconds here, so callers get one type. null when unreported or unreadable.

nullable
true
stopTimenumberrequired

Reserved window end as Unix SECONDS. Same normalisation as startTime.

nullable
true
expiresAtstringrequired

When the RESERVATION's locked price and inventory expire. It is set after reserving, so a plain quote carries null here. THE VALUE IS THE PLATFORM'S: this API embeds no reservation lifetime of its own, because the vendor describes it only as "approximately one hour" -- an observation, not a guarantee, and one that would go stale silently if it were hard-coded.

nullable
true
Original schema
{
  "$ref": "#/components/schemas/RfPredictionEnvelopeDto"
}
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"
}
403Permission denied

Permission denied

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.

CreateRfPredictionDto

#/components/schemas/CreateRfPredictionDto

{
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Social account id used to resolve the platform token."
    },
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "Meta ad account id (act_<n>) the prediction is quoted on."
    },
    "budgetAmount": {
      "type": "number",
      "description": "Lifetime budget for the window, and sending it means THE PLATFORM PREDICTS THE REACH. EXACTLY ONE of `budgetAmount` / `reach` is required; both, or neither, is a 400 with its own code.\n\nTHE VALUE IS FORWARDED UNCHANGED and the platform reads it in the MINOR unit of the ad account currency -- cents for USD. This request carries no currency field, so this API cannot convert whole units for you and does not try: send the minor-unit amount."
    },
    "reach": {
      "type": "number",
      "description": "Target unique reach, and sending it means THE PLATFORM PREDICTS THE BUDGET. EXACTLY ONE of `budgetAmount` / `reach` is required."
    },
    "startDate": {
      "type": "string",
      "format": "date-time",
      "description": "Campaign window start. The platform requires it to be in the future; that check is NOT made here, because \"future\" depends on a clock this API does not share with the platform, and rejecting a borderline window locally would cost you one the platform would have accepted."
    },
    "endDate": {
      "type": "string",
      "format": "date-time",
      "description": "Campaign window end. It must be after `startDate`, and the window may span at most 56 days (eight weeks) -- that limit is the platform's and is enforced before the request leaves this API."
    },
    "frequencyCap": {
      "type": "number",
      "minimum": 1,
      "maximum": 90,
      "description": "Max impressions per person over the window. THE BOUNDS ARE THIS API'S, not measurably the platform's: the vendor documents the field as a plain integer with no stated range, so a value outside 1..90 is refused here even if the platform might have taken it."
    },
    "targeting": {
      "type": "object",
      "description": "Canonical camelCase targeting spec. It is TRANSLATED to the platform's own snake_case targeting object by the same translator the reach-estimate endpoint uses, so only the canonical keys are accepted; an unknown key is refused here rather than forwarded, because the platform would otherwise drop it silently and quote an untargeted reach.\n\nTHERE IS NO DEFAULT. Omit it and this API sends no targeting at all, leaving the platform's own default in force; it does not substitute one of its own."
    },
    "placements": {
      "type": "object",
      "description": "Placements object. A TOP-LEVEL `placements` WINS over a `placements` key nested inside `targeting`; when neither is set, no placement fields are sent and the platform's own default applies. Reservation campaigns reject automatic placements, and that rejection comes from the platform -- this API does not pre-empt it, because the wire shape of \"automatic\" was never measured."
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "adAccountId",
    "startDate",
    "endDate"
  ]
}
RfPredictionEnvelopeDto

#/components/schemas/RfPredictionEnvelopeDto

{
  "type": "object",
  "properties": {
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "The ad account the prediction belongs to, echoed back from your request. It is NOT read out of the platform response: the node does not carry it, and deriving it would mean publishing a value that was never observed."
    },
    "currency": {
      "type": "string",
      "nullable": true,
      "description": "The ad account currency the money fields are denominated in, as the platform reported it. `null` when the platform did not report one -- this API does not fall back to a default, because a wrong currency would silently mis-scale every amount above."
    },
    "prediction": {
      "$ref": "#/components/schemas/RfPredictionDto"
    }
  },
  "required": [
    "adAccountId",
    "currency",
    "prediction"
  ]
}
RfPredictionDto

#/components/schemas/RfPredictionDto

{
  "type": "object",
  "properties": {
    "predictionId": {
      "type": "string",
      "pattern": "^[1-9]\\d{0,20}$",
      "description": "The platform's own prediction id. AFTER A RESERVE THIS IS A NEW id, not the one you reserved: reserving mints a fresh object. It is the RESERVED id that belongs on POST /v1/ads/create and on the DELETE that releases it."
    },
    "status": {
      "type": "number",
      "description": "The platform's own numeric prediction status, forwarded AS IS. THIS API PUBLISHES NO NAMES FOR IT: the vendor documents the field only as an unsigned integer and never states what each value means, so any mapping here would be invented. Treat the number as opaque and poll GET /v1/ads/rf-predictions/{predictionId} until it stops changing."
    },
    "budget": {
      "type": "number",
      "nullable": true,
      "description": "Quoted (or provided) lifetime budget for the window, in the MINOR unit of `currency` -- cents for USD -- exactly as the platform reported it. THIS API DOES NOT CONVERT: the divisor depends on the currency (JPY, KRW and CLP have no minor unit at all), so a fixed divide-by-100 would be wrong for them. `null` means the platform did not report a number, which is not the same fact as zero."
    },
    "reach": {
      "type": "number",
      "nullable": true,
      "description": "Predicted (or requested) unique reach. `null` when unreported."
    },
    "impressions": {
      "type": "number",
      "nullable": true,
      "description": "Predicted impressions over the window. `null` when unreported."
    },
    "minBudget": {
      "type": "number",
      "nullable": true,
      "description": "The platform's allowed LOWER bound for this spec, in the MINOR unit of `currency`, unconverted. `null` when unreported."
    },
    "maxBudget": {
      "type": "number",
      "nullable": true,
      "description": "The platform's allowed UPPER bound for this spec, in the MINOR unit of `currency`, unconverted. `null` when unreported."
    },
    "minReach": {
      "type": "number",
      "nullable": true,
      "description": "The platform's allowed lower bound on reach."
    },
    "maxReach": {
      "type": "number",
      "nullable": true,
      "description": "The platform's allowed upper bound on reach."
    },
    "frequencyCap": {
      "type": "number",
      "nullable": true,
      "description": "Max impressions per person over the window, echoed by the platform. `null` when you did not send one and the platform did not report one -- this API does not substitute the platform's own default, because that default was never measured."
    },
    "startTime": {
      "type": "number",
      "nullable": true,
      "description": "Reserved window start as Unix SECONDS. The platform may report this as an ISO-8601 timestamp instead; either form is normalised to seconds here, so callers get one type. `null` when unreported or unreadable."
    },
    "stopTime": {
      "type": "number",
      "nullable": true,
      "description": "Reserved window end as Unix SECONDS. Same normalisation as `startTime`."
    },
    "expiresAt": {
      "type": "string",
      "nullable": true,
      "description": "When the RESERVATION's locked price and inventory expire. It is set after reserving, so a plain quote carries `null` here. THE VALUE IS THE PLATFORM'S: this API embeds no reservation lifetime of its own, because the vendor describes it only as \"approximately one hour\" -- an observation, not a guarantee, and one that would go stale silently if it were hard-coded."
    }
  },
  "required": [
    "predictionId",
    "status",
    "budget",
    "reach",
    "impressions",
    "minBudget",
    "maxBudget",
    "minReach",
    "maxReach",
    "frequencyCap",
    "startTime",
    "stopTime",
    "expiresAt"
  ]
}
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"
  ]
}