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

Create a custom conversion, or reuse the matching one

Creates a custom conversion on an ad account, or RETURNS THE EXISTING ONE when a non-archived conversion already has the same name on the same pixelId. A reused conversion answers 200; a newly created one answers 201, and reused in the body says which happened.

THE REUSE IS THIS API'S, NOT THE PLATFORM'S. The platform create is not idempotent, so a retried request would otherwise mint a duplicate carrying none of the original's optimisation history. That is also why no Idempotency-Key is accepted: the reuse key -- name plus pixelId -- already makes a retry safe, and the tracked contract declares no header here.

THE REUSE SCAN READS ONE PAGE. An ad account holding more custom conversions than 200 can therefore hold a match the scan does not see, and this call would then create a second conversion with the same name. The platform offers no server-side name filter, so a full scan would cost a number of calls that grows with your account and cannot be priced as one operation. List first if your account is that large.

rule is forwarded VERBATIM in the platform's own grammar -- not translated, not validated here. A rule the platform refuses comes back as a 400 carrying its reason.

Only served for Meta today; another platform answers 501.

Authentication

The following security requirement applies to this operation.

  1. bearerhttp

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

Parameters

accountIdpathrequired

The connected Meta account id. It is what resolves the platform token; it is NOT the ad account and NOT the pixel.

accountIdstringrequired
Original schema
{
  "type": "string"
}
platformqueryoptional

Defaults to 'facebook'. Only Meta is served today; anything else is a 501 rather than a silent empty answer. NOT IN THE PUBLISHED CONTRACT for these operations -- it is accepted because every sibling ads operation carries it, so the same query shape works across the vertical.

platformstring
Original schema
{
  "type": "string"
}

Request body

Required body
application/json
Bodyobjectrequired
#/components/schemas/CreateCustomConversionDto
additionalProperties
false
required
[ "adAccountId", "name", "pixelId", "customEventType", "rule" ]
adAccountIdstringrequired

The act_<n> ad account the conversion is created on.

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

Conversion name, AND HALF OF THE REUSE KEY (the other half is pixelId). Sending a name that already exists on the same pixel returns that conversion with a 200 instead of creating a second one.

minLength
1
maxLength
255
pixelIdstringrequired

The pixel the rule reads from. Get it from GET /v1/accounts/{accountId}/tracking-tags -- tags[].id is exactly this value, with no conversion.

customEventTypestringrequired

The platform event type, e.g. LEAD, PURCHASE, OTHER. NOT CHECKED AGAINST AN ENUM -- see the field of the same name on the conversion itself.

ruleobjectrequired

The rule, in the platform's own grammar, forwarded VERBATIM. This API does not translate, validate or reshape it; a rule the platform refuses comes back as a 400 carrying the platform's own reason.

additionalProperties
true
Original schema
{
  "$ref": "#/components/schemas/CreateCustomConversionDto"
}

Responses

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

200Response details

An existing non-archived conversion matched name + pixelId and was returned instead of creating a second one. reused is true.

application/json
Response 200object
#/components/schemas/CustomConversionResultDto
required
[ "adAccountId", "customConversionId", "reused", "customConversion" ]
adAccountIdstringrequired

Echo of the ad account the conversion belongs to.

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

Platform id of the conversion. DROPS STRAIGHT INTO adSet.promotedObject.customConversionId on the ad-creating endpoints -- no conversion of the value is needed.

reusedbooleanrequired

True when an existing NON-ARCHIVED conversion matched name + pixelId and was returned instead of creating a second one; the response is then a 200 rather than a 201.

THE REUSE IS THIS API'S, NOT THE PLATFORM'S. The platform create is not idempotent, so without it a retried request would mint a duplicate carrying none of the original's optimisation history.

customConversionobjectrequired
#/components/schemas/CustomConversionDto
required
[ "id", "name", "rule", "customEventType", "pixelId", "isArchived" ]
idstringrequired

Platform id of the custom conversion.

namestringrequired

Conversion name. TOGETHER WITH pixelId THIS IS THE REUSE KEY: creating with the same pair returns the existing conversion instead of minting a second one.

nullable
true
ruleobjectrequired

The platform's own rule grammar, parsed back from the string the platform stores. It is forwarded and returned VERBATIM -- no key is renamed, added or dropped, because the grammar is the platform's and translating it here would corrupt rules this API does not know.

nullable
true
additionalProperties
true
customEventTypestringrequired

The platform event type, e.g. LEAD, PURCHASE, OTHER. NOT VALIDATED AGAINST AN ENUM: the platform publishes no enumeration for this field, and writing our own would refuse values the platform accepts.

nullable
true
pixelIdstringrequired

The pixel the rule reads from (the platform calls it event_source_id). Discover it with GET /v1/accounts/{accountId}/tracking-tags.

nullable
true
isArchivedbooleanrequired

Archived conversions ARE listed, and this flag is the only thing that tells them apart. Filtering them out here would close the only surface on which an archived conversion is visible at all.

Original schema
{
  "$ref": "#/components/schemas/CustomConversionResultDto"
}
201Response schema
application/json
Response 201object
#/components/schemas/CustomConversionResultDto
required
[ "adAccountId", "customConversionId", "reused", "customConversion" ]
adAccountIdstringrequired

Echo of the ad account the conversion belongs to.

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

Platform id of the conversion. DROPS STRAIGHT INTO adSet.promotedObject.customConversionId on the ad-creating endpoints -- no conversion of the value is needed.

reusedbooleanrequired

True when an existing NON-ARCHIVED conversion matched name + pixelId and was returned instead of creating a second one; the response is then a 200 rather than a 201.

THE REUSE IS THIS API'S, NOT THE PLATFORM'S. The platform create is not idempotent, so without it a retried request would mint a duplicate carrying none of the original's optimisation history.

customConversionobjectrequired
#/components/schemas/CustomConversionDto
required
[ "id", "name", "rule", "customEventType", "pixelId", "isArchived" ]
idstringrequired

Platform id of the custom conversion.

namestringrequired

Conversion name. TOGETHER WITH pixelId THIS IS THE REUSE KEY: creating with the same pair returns the existing conversion instead of minting a second one.

nullable
true
ruleobjectrequired

The platform's own rule grammar, parsed back from the string the platform stores. It is forwarded and returned VERBATIM -- no key is renamed, added or dropped, because the grammar is the platform's and translating it here would corrupt rules this API does not know.

nullable
true
additionalProperties
true
customEventTypestringrequired

The platform event type, e.g. LEAD, PURCHASE, OTHER. NOT VALIDATED AGAINST AN ENUM: the platform publishes no enumeration for this field, and writing our own would refuse values the platform accepts.

nullable
true
pixelIdstringrequired

The pixel the rule reads from (the platform calls it event_source_id). Discover it with GET /v1/accounts/{accountId}/tracking-tags.

nullable
true
isArchivedbooleanrequired

Archived conversions ARE listed, and this flag is the only thing that tells them apart. Filtering them out here would close the only surface on which an archived conversion is visible at all.

Original schema
{
  "$ref": "#/components/schemas/CustomConversionResultDto"
}
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.

CreateCustomConversionDto

#/components/schemas/CreateCustomConversionDto

{
  "type": "object",
  "properties": {
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "The `act_<n>` ad account the conversion is created on."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Conversion name, AND HALF OF THE REUSE KEY (the other half is `pixelId`). Sending a name that already exists on the same pixel returns that conversion with a 200 instead of creating a second one."
    },
    "pixelId": {
      "type": "string",
      "description": "The pixel the rule reads from. Get it from `GET /v1/accounts/{accountId}/tracking-tags` -- `tags[].id` is exactly this value, with no conversion."
    },
    "customEventType": {
      "type": "string",
      "description": "The platform event type, e.g. `LEAD`, `PURCHASE`, `OTHER`. NOT CHECKED AGAINST AN ENUM -- see the field of the same name on the conversion itself."
    },
    "rule": {
      "type": "object",
      "additionalProperties": true,
      "description": "The rule, in the platform's own grammar, forwarded VERBATIM. This API does not translate, validate or reshape it; a rule the platform refuses comes back as a 400 carrying the platform's own reason."
    }
  },
  "additionalProperties": false,
  "required": [
    "adAccountId",
    "name",
    "pixelId",
    "customEventType",
    "rule"
  ]
}
CustomConversionResultDto

#/components/schemas/CustomConversionResultDto

{
  "type": "object",
  "properties": {
    "adAccountId": {
      "type": "string",
      "pattern": "^act_[1-9]\\d{0,19}$",
      "description": "Echo of the ad account the conversion belongs to."
    },
    "customConversionId": {
      "type": "string",
      "description": "Platform id of the conversion. DROPS STRAIGHT INTO `adSet.promotedObject.customConversionId` on the ad-creating endpoints -- no conversion of the value is needed."
    },
    "reused": {
      "type": "boolean",
      "description": "True when an existing NON-ARCHIVED conversion matched `name` + `pixelId` and was returned instead of creating a second one; the response is then a 200 rather than a 201.\n\nTHE REUSE IS THIS API'S, NOT THE PLATFORM'S. The platform create is not idempotent, so without it a retried request would mint a duplicate carrying none of the original's optimisation history."
    },
    "customConversion": {
      "$ref": "#/components/schemas/CustomConversionDto"
    }
  },
  "required": [
    "adAccountId",
    "customConversionId",
    "reused",
    "customConversion"
  ]
}
CustomConversionDto

#/components/schemas/CustomConversionDto

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Platform id of the custom conversion."
    },
    "name": {
      "type": "string",
      "nullable": true,
      "description": "Conversion name. TOGETHER WITH `pixelId` THIS IS THE REUSE KEY: creating with the same pair returns the existing conversion instead of minting a second one."
    },
    "rule": {
      "type": "object",
      "nullable": true,
      "additionalProperties": true,
      "description": "The platform's own rule grammar, parsed back from the string the platform stores. It is forwarded and returned VERBATIM -- no key is renamed, added or dropped, because the grammar is the platform's and translating it here would corrupt rules this API does not know."
    },
    "customEventType": {
      "type": "string",
      "nullable": true,
      "description": "The platform event type, e.g. `LEAD`, `PURCHASE`, `OTHER`. NOT VALIDATED AGAINST AN ENUM: the platform publishes no enumeration for this field, and writing our own would refuse values the platform accepts."
    },
    "pixelId": {
      "type": "string",
      "nullable": true,
      "description": "The pixel the rule reads from (the platform calls it `event_source_id`). Discover it with `GET /v1/accounts/{accountId}/tracking-tags`."
    },
    "isArchived": {
      "type": "boolean",
      "description": "Archived conversions ARE listed, and this flag is the only thing that tells them apart. Filtering them out here would close the only surface on which an archived conversion is visible at all."
    }
  },
  "required": [
    "id",
    "name",
    "rule",
    "customEventType",
    "pixelId",
    "isArchived"
  ]
}
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"
  ]
}