zumpo/docs
Dashboard
Skip to content
ad-targeting / API reference
POSTestimateAdReach

Estimate how many people a targeting spec would reach

Returns the platform's own estimate of the audience a TargetingSpec would reach, WITHOUT creating anything and without spending budget.

IT IS A RANGE, NOT A NUMBER. lower and upper bound a MONTHLY ACTIVE audience; the platform deliberately does not commit to a single figure, so this API does not average them into one.

optimizationGoal IS REQUIRED HERE, and that deviates from the published contract, which calls it optional and says to omit it for the platform default. THE PLATFORM HAS NO SUCH DEFAULT -- the parameter is mandatory on its edge -- and choosing one on your behalf would silently change the audience size you are shown.

daily AND currency ARE ALWAYS null. The platform removed the services behind the daily figure and states no replacement exists, and nothing in this request or response is monetary, so there is nothing to denominate. Both fields are kept so a client generated from the contract still compiles.

CHECK estimateReady BEFORE TRUSTING THE BOUNDS: the platform answers 200 with estimateReady: false while it is still computing a very new audience, and the bounds may be null in that state.

Only served for Meta today. Another platform 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/EstimateAdReachDto
additionalProperties
false
required
[ "accountId", "adAccountId", "spec", "optimizationGoal" ]
accountIdstringrequired

Zumpo social account id. It is what resolves the platform token; it is NOT the ad account.

adAccountIdstringrequired

The ad account the estimate is computed against, in act_<id> form. It cannot be derived from accountId: one social account can reach many ad accounts. Get it from GET /v1/ads/accounts.

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

Canonical camelCase targeting spec -- the SAME component used by POST /v1/ads/create and the saved-targeting audiences, so a spec resolved once is reusable verbatim. Translation into the platform's own targeting_spec dictionary happens in the adapter.

allOf / 1object
#/components/schemas/AdTargetingSpecDto
additionalProperties
false
countriesarray
Array itemstring
regionsarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
citiesarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
zipsarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
metrosarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
customLocationsarray
Array itemobject
excludedLocationsobject
#/components/schemas/AdExcludedLocationsDto
additionalProperties
false
countriesarray
Array itemstring
regionsarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
citiesarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
zipsarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
placesarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
neighborhoodsarray
Array itemobject
#/components/schemas/AdTargetingEntityDto
additionalProperties
false
required
[ "key" ]
keystringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
radiusnumber
minimum
0
exclusiveMinimum
true
distanceUnitstring
enum
[ "mile", "kilometer" ]
customLocationsarray
Array itemobject
ageMinnumber
minimum
13
maximum
100
ageMaxnumber
minimum
13
maximum
100
genderstring
enum
[ "all", "male", "female" ]
incomeTierstring
enum
[ "top_5", "top_10", "top_10_25", "top_25_50" ]
languagesarray
Array itemstring
interestsarray
Array itemobject
#/components/schemas/AdTargetingInterestDto
additionalProperties
false
required
[ "id" ]
idstringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
behaviorsarray
Array itemobject
#/components/schemas/AdTargetingInterestDto
additionalProperties
false
required
[ "id" ]
idstringrequired
minLength
1
maxLength
256
namestring
minLength
1
maxLength
512
industriesarray
Array itemstring
companySizesarray
Array itemstring
senioritiesarray
Array itemstring
jobFunctionsarray
Array itemstring
audienceIncludearray
Array itemstring
audienceExcludearray
Array itemstring
optimizationGoalstringrequired

What the ad set would be optimised for, e.g. REACH, IMPRESSIONS, LINK_CLICKS, OFFSITE_CONVERSIONS.

REQUIRED, and this deviates from the published contract, which calls it optional and says to omit it for "the platform default". META HAS NO SUCH DEFAULT -- the parameter is mandatory on the platform edge. Choosing one here would silently change the audience size you are shown, so the field is rejected by name instead of guessed.

The value list is NOT pinned: the platform keeps adding goals, so its own error is the authority on which ones exist. Only the SHAPE is checked here (upper-case, digits and underscores).

pattern
^[A-Z][A-Z0-9_]{0,63}$
platformstring

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

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

Responses

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

200Response schema
application/json
Response 200object
#/components/schemas/AdReachEstimateResponseDto
additionalProperties
false
required
[ "available", "lower", "upper", "daily", "currency", "estimateReady" ]
availablebooleanrequired

Whether the platform served an estimate. ALWAYS true here: this API only serves Meta, and a non-Meta account never reaches this operation -- it is rejected earlier by name rather than answered with an empty estimate.

lowernumberrequired

Lower bound of the estimated MONTHLY ACTIVE audience for this targeting. null when the platform did not supply one -- which is a normal answer while estimateReady is false, not an error. It is reported separately from upper on purpose: the platform deliberately does not commit to a single number, and averaging the two would invent a precision it never gave.

nullable
true
uppernumberrequired

Upper bound of the estimated monthly active audience, or null. See lower.

nullable
true
dailynumberrequired

ALWAYS null. The platform used to derive a daily figure from daily_outcomes_curve / estimate_dau; BOTH were removed in the platform API version this integration targets, and the vendor states that no replacement is available. There is nothing left to read, and dividing the monthly range would manufacture a precision the platform deliberately stopped giving.

nullable
true
currencystringrequired

ALWAYS null. Neither the request nor the platform response carries a monetary field, so there is nothing to denominate. Filling it would cost a second platform call for a value no other field in this response depends on.

nullable
true
estimateReadybooleanrequired

Meta only. false while the platform is still computing the estimate for a very new audience -- that is a 200, not an error. TREAT lower/upper AS UNTRUSTWORTHY WHILE THIS IS false: the platform does not document what the bounds hold in that state, which is why they are nullable rather than zero. Declared nullable to match the contract; in practice Meta always supplies a boolean.

nullable
true
Original schema
{
  "$ref": "#/components/schemas/AdReachEstimateResponseDto"
}
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"
}
404Response schema
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.

EstimateAdReachDto

#/components/schemas/EstimateAdReachDto

{
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Zumpo social account id. It is what resolves the platform token; it is NOT the ad account."
    },
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "The ad account the estimate is computed against, in `act_<id>` form. It cannot be derived from `accountId`: one social account can reach many ad accounts. Get it from `GET /v1/ads/accounts`."
    },
    "spec": {
      "description": "Canonical camelCase targeting spec -- the SAME component used by `POST /v1/ads/create` and the saved-targeting audiences, so a spec resolved once is reusable verbatim. Translation into the platform's own `targeting_spec` dictionary happens in the adapter.",
      "allOf": [
        {
          "$ref": "#/components/schemas/AdTargetingSpecDto"
        }
      ]
    },
    "optimizationGoal": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9_]{0,63}$",
      "description": "What the ad set would be optimised for, e.g. `REACH`, `IMPRESSIONS`, `LINK_CLICKS`, `OFFSITE_CONVERSIONS`.\n\nREQUIRED, and this deviates from the published contract, which calls it optional and says to omit it for \"the platform default\". META HAS NO SUCH DEFAULT -- the parameter is mandatory on the platform edge. Choosing one here would silently change the audience size you are shown, so the field is rejected by name instead of guessed.\n\nThe value list is NOT pinned: the platform keeps adding goals, so its own error is the authority on which ones exist. Only the SHAPE is checked here (upper-case, digits and underscores)."
    },
    "platform": {
      "type": "string",
      "description": "Defaults to 'facebook'. Only Meta is served today."
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "adAccountId",
    "spec",
    "optimizationGoal"
  ]
}
AdTargetingSpecDto

#/components/schemas/AdTargetingSpecDto

{
  "type": "object",
  "properties": {
    "countries": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "regions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "cities": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "zips": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "metros": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "customLocations": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "excludedLocations": {
      "$ref": "#/components/schemas/AdExcludedLocationsDto"
    },
    "ageMin": {
      "type": "number",
      "minimum": 13,
      "maximum": 100
    },
    "ageMax": {
      "type": "number",
      "minimum": 13,
      "maximum": 100
    },
    "gender": {
      "type": "string",
      "enum": [
        "all",
        "male",
        "female"
      ]
    },
    "incomeTier": {
      "type": "string",
      "enum": [
        "top_5",
        "top_10",
        "top_10_25",
        "top_25_50"
      ]
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "interests": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingInterestDto"
      }
    },
    "behaviors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingInterestDto"
      }
    },
    "industries": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "companySizes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "seniorities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "jobFunctions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "audienceInclude": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "audienceExclude": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
AdTargetingEntityDto

#/components/schemas/AdTargetingEntityDto

{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "radius": {
      "type": "number",
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "distanceUnit": {
      "type": "string",
      "enum": [
        "mile",
        "kilometer"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "key"
  ]
}
AdExcludedLocationsDto

#/components/schemas/AdExcludedLocationsDto

{
  "type": "object",
  "properties": {
    "countries": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "regions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "cities": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "zips": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "places": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "neighborhoods": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdTargetingEntityDto"
      }
    },
    "customLocations": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  },
  "additionalProperties": false
}
AdTargetingInterestDto

#/components/schemas/AdTargetingInterestDto

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
  ]
}
AdReachEstimateResponseDto

#/components/schemas/AdReachEstimateResponseDto

{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "Whether the platform served an estimate. ALWAYS `true` here: this API only serves Meta, and a non-Meta account never reaches this operation -- it is rejected earlier by name rather than answered with an empty estimate."
    },
    "lower": {
      "type": "number",
      "nullable": true,
      "description": "Lower bound of the estimated MONTHLY ACTIVE audience for this targeting. `null` when the platform did not supply one -- which is a normal answer while `estimateReady` is `false`, not an error. It is reported separately from `upper` on purpose: the platform deliberately does not commit to a single number, and averaging the two would invent a precision it never gave."
    },
    "upper": {
      "type": "number",
      "nullable": true,
      "description": "Upper bound of the estimated monthly active audience, or `null`. See `lower`."
    },
    "daily": {
      "type": "number",
      "nullable": true,
      "description": "ALWAYS `null`. The platform used to derive a daily figure from `daily_outcomes_curve` / `estimate_dau`; BOTH were removed in the platform API version this integration targets, and the vendor states that no replacement is available. There is nothing left to read, and dividing the monthly range would manufacture a precision the platform deliberately stopped giving."
    },
    "currency": {
      "type": "string",
      "nullable": true,
      "description": "ALWAYS `null`. Neither the request nor the platform response carries a monetary field, so there is nothing to denominate. Filling it would cost a second platform call for a value no other field in this response depends on."
    },
    "estimateReady": {
      "type": "boolean",
      "nullable": true,
      "description": "Meta only. `false` while the platform is still computing the estimate for a very new audience -- that is a 200, not an error. TREAT `lower`/`upper` AS UNTRUSTWORTHY WHILE THIS IS `false`: the platform does not document what the bounds hold in that state, which is why they are nullable rather than zero. Declared nullable to match the contract; in practice Meta always supplies a boolean."
    }
  },
  "additionalProperties": false,
  "required": [
    "available",
    "lower",
    "upper",
    "daily",
    "currency",
    "estimateReady"
  ]
}
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"
  ]
}