Create a lead form
Creates a Lead Gen form on the connected Facebook Page and returns its id.
SEND THE FORM CONTENT INSIDE platformSpecificData. The old top-level fields (questions, thankYou*, locale, ...) are DEPRECATED but still accepted while platformSpecificData is ABSENT; sending BOTH shapes is a 400, because there would be no way to tell which one you meant. name and privacyPolicyUrl stay top-level in both shapes.
platformSpecificData is STRICT-PARSED: an unknown field is a 400, never a silently dropped one.
The form is created ACTIVE: the platform takes no status on this edge, so a draft cannot be created in one call.
THIS OPERATION IS NOT IDEMPOTENT: the same body sent twice creates TWO forms on the Page. No Idempotency-Key is accepted, because the contract this API tracks declares none for this resource while declaring one explicitly for other write endpoints -- the silence is a choice, not an omission. Do not auto-retry a create.
The returned name is the name the form was created with -- ECHOED from your request when the platform does not return one. This edge accepts no field selection, so a read-after-write is not available and a second call would double the operation's price.
A 403 with code facebook_lead_form_permission_missing means the connected Facebook account lacks pages_manage_ads. Lead form edges are PAGE edges, not ad-account edges, so they need a Page permission that older connections were never asked for: reconnect the account to grant it. The call is stopped before it reaches the platform, so it costs nothing.
Authentication
The following security requirement applies to this operation.
Read the authentication guideParameters
This operation declares no path, query, header or cookie parameters.
Request body
Bodyobjectrequired
- additionalProperties
false- required
[ "accountId", "name", "privacyPolicyUrl" ]
accountIdstringrequiredSocial account id used to resolve the platform token.
namestringrequiredForm name. Internal -- the person filling the form does not see it.
- maxLength
200
privacyPolicyUrlstringrequiredPrivacy policy URL shown on the form. REQUIRED by the platform, and stays top-level in BOTH shapes. Its validity is the platform's call, not pre-judged here.
- format
uri
questionsarray
DEPRECATED legacy Meta shape: use platformSpecificData.questions. Still accepted while platformSpecificData is ABSENT; sending both shapes is a 400.
- minItems
1- deprecated
true
Array itemobject
- required
[ "type" ]
typestringrequiredEMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM and the rest of the platform's list. NOT validated against a pinned enum: the platform keeps its own set and its error is the authority on which types exist.
keystringCUSTOM questions only. The rule is NOT enforced here: the platform documents both fields as optional and only its examples pair them with CUSTOM, so enforcing it would reject a body the platform accepts.
labelstringCUSTOM questions only. See the note on key.
optionsarray
Array itemobject
keystringvaluestringinline_contextstringSnake_case on purpose -- it is the name the contract declares for this field, next to camelCase siblings.
privacyPolicyLinkTextstringDeprecated: use platformSpecificData.privacyPolicyLinkText.
- maxLength
70- deprecated
true
followUpActionUrlstringDeprecated: use platformSpecificData.followUpActionUrl.
- format
uri- deprecated
true
localestringDeprecated: use platformSpecificData.locale.
- example
EN_US- deprecated
true
thankYouTitlestringDeprecated: use platformSpecificData.thankYouTitle.
- deprecated
true
thankYouBodystringDeprecated: use platformSpecificData.thankYouBody.
- deprecated
true
thankYouButtonTextstringDeprecated: use platformSpecificData.thankYouButtonText.
- deprecated
true
thankYouButtonTypestringDeprecated: use platformSpecificData.thankYouButtonType.
- example
VIEW_WEBSITE- deprecated
true
thankYouWebsiteUrlstringDeprecated: use platformSpecificData.thankYouWebsiteUrl.
- format
uri- deprecated
true
isOptimizedForQualitybooleanDeprecated: use platformSpecificData.isOptimizedForQuality.
- deprecated
true
platformSpecificDataallOf
Form content, strict-parsed: an unknown field is a 400, never a silently dropped one. Sending this together with ANY of the deprecated top-level fields above is a 400 -- there would be no way to tell which of the two the caller meant.
allOf / 1object
- required
[ "questions" ]
questionsarrayrequired
The questions the form asks. An EMPTY array is rejected: a form with no questions collects nothing, and the platform refuses it anyway.
- minItems
1
Array itemobject
- required
[ "type" ]
typestringrequiredEMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM and the rest of the platform's list. NOT validated against a pinned enum: the platform keeps its own set and its error is the authority on which types exist.
keystringCUSTOM questions only. The rule is NOT enforced here: the platform documents both fields as optional and only its examples pair them with CUSTOM, so enforcing it would reject a body the platform accepts.
labelstringCUSTOM questions only. See the note on key.
optionsarray
Array itemobject
keystringvaluestringinline_contextstringSnake_case on purpose -- it is the name the contract declares for this field, next to camelCase siblings.
privacyPolicyLinkTextstring- maxLength
70
followUpActionUrlstring- format
uri
localestringLANGUAGE_REGION, upper case. The exact shape is enforced one layer down, where the platform-specific rule lives.
- example
EN_US
thankYouTitlestringthankYouBodystringthankYouButtonTextstringthankYouButtonTypestring- example
VIEW_WEBSITE
thankYouWebsiteUrlstring- format
uri
isOptimizedForQualitybooleanSet true for a higher-intent form (adds a review step before submit).
platformstringDefaults to 'facebook'. Only Meta is served today.
Original schema
{
"$ref": "#/components/schemas/CreateAdLeadFormDto"
}Responses
Status codes and shapes declared for this operation. Read each description for the meaning of that response.
200Response schema
Response 200object
- required
[ "form" ]
formobjectrequired
- required
[ "id", "name" ]
idstringrequired- pattern
^[1-9]\d{0,19}$
namestringrequiredThe name the form was created with. ECHOED from the request when the platform does not return one -- this edge accepts no field selection, so a read-after-write is not available and a second call would double the operation's price.
Original schema
{
"$ref": "#/components/schemas/CreateAdLeadFormResponseDto"
}400Response schema
Response 400object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 401object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 403object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 404object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 409object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 429object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 500object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 501object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 502object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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
Response 503object
- required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequiredHuman-readable message. UNSTABLE — do not branch on it.
- example
WhatsApp session window expired; use a template message.
typestringrequiredStable 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
codestringrequiredStable machine-readable code.
- example
whatsapp_window_expired
paramstringOffending parameter, present only when relevant.
- example
body
docUrlstringrequiredhttps://docs.zumpo.io/errors/{code}
- example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequiredSupport correlation id: req_ + 16 hex.
- example
req_7f3a9c2e1b8d4056
detailsobjectAdditional 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.
CreateAdLeadFormDto
#/components/schemas/CreateAdLeadFormDto
{
"type": "object",
"properties": {
"accountId": {
"type": "string",
"description": "Social account id used to resolve the platform token."
},
"name": {
"type": "string",
"maxLength": 200,
"description": "Form name. Internal -- the person filling the form does not see it."
},
"privacyPolicyUrl": {
"type": "string",
"format": "uri",
"description": "Privacy policy URL shown on the form. REQUIRED by the platform, and stays top-level in BOTH shapes. Its validity is the platform's call, not pre-judged here."
},
"questions": {
"minItems": 1,
"deprecated": true,
"description": "DEPRECATED legacy Meta shape: use `platformSpecificData.questions`. Still accepted while `platformSpecificData` is ABSENT; sending both shapes is a 400.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AdLeadFormQuestionDto"
}
},
"privacyPolicyLinkText": {
"type": "string",
"maxLength": 70,
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.privacyPolicyLinkText`."
},
"followUpActionUrl": {
"type": "string",
"format": "uri",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.followUpActionUrl`."
},
"locale": {
"type": "string",
"example": "EN_US",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.locale`."
},
"thankYouTitle": {
"type": "string",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.thankYouTitle`."
},
"thankYouBody": {
"type": "string",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.thankYouBody`."
},
"thankYouButtonText": {
"type": "string",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.thankYouButtonText`."
},
"thankYouButtonType": {
"type": "string",
"example": "VIEW_WEBSITE",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.thankYouButtonType`."
},
"thankYouWebsiteUrl": {
"type": "string",
"format": "uri",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.thankYouWebsiteUrl`."
},
"isOptimizedForQuality": {
"type": "boolean",
"deprecated": true,
"description": "Deprecated: use `platformSpecificData.isOptimizedForQuality`."
},
"platformSpecificData": {
"description": "Form content, strict-parsed: an unknown field is a 400, never a silently dropped one. Sending this together with ANY of the deprecated top-level fields above is a 400 -- there would be no way to tell which of the two the caller meant.",
"allOf": [
{
"$ref": "#/components/schemas/MetaAdLeadFormPlatformDataDto"
}
]
},
"platform": {
"type": "string",
"description": "Defaults to 'facebook'. Only Meta is served today."
}
},
"additionalProperties": false,
"required": [
"accountId",
"name",
"privacyPolicyUrl"
]
}AdLeadFormQuestionDto
#/components/schemas/AdLeadFormQuestionDto
{
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM and the rest of the platform's list. NOT validated against a pinned enum: the platform keeps its own set and its error is the authority on which types exist."
},
"key": {
"type": "string",
"description": "CUSTOM questions only. The rule is NOT enforced here: the platform documents both fields as optional and only its examples pair them with CUSTOM, so enforcing it would reject a body the platform accepts."
},
"label": {
"type": "string",
"description": "CUSTOM questions only. See the note on `key`."
},
"options": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AdLeadFormQuestionOptionDto"
}
},
"inline_context": {
"type": "string",
"description": "Snake_case on purpose -- it is the name the contract declares for this field, next to camelCase siblings."
}
},
"required": [
"type"
]
}AdLeadFormQuestionOptionDto
#/components/schemas/AdLeadFormQuestionOptionDto
{
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}MetaAdLeadFormPlatformDataDto
#/components/schemas/MetaAdLeadFormPlatformDataDto
{
"type": "object",
"properties": {
"questions": {
"minItems": 1,
"description": "The questions the form asks. An EMPTY array is rejected: a form with no questions collects nothing, and the platform refuses it anyway.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AdLeadFormQuestionDto"
}
},
"privacyPolicyLinkText": {
"type": "string",
"maxLength": 70
},
"followUpActionUrl": {
"type": "string",
"format": "uri"
},
"locale": {
"type": "string",
"example": "EN_US",
"description": "LANGUAGE_REGION, upper case. The exact shape is enforced one layer down, where the platform-specific rule lives."
},
"thankYouTitle": {
"type": "string"
},
"thankYouBody": {
"type": "string"
},
"thankYouButtonText": {
"type": "string"
},
"thankYouButtonType": {
"type": "string",
"example": "VIEW_WEBSITE"
},
"thankYouWebsiteUrl": {
"type": "string",
"format": "uri"
},
"isOptimizedForQuality": {
"type": "boolean",
"description": "Set true for a higher-intent form (adds a review step before submit)."
}
},
"required": [
"questions"
]
}CreateAdLeadFormResponseDto
#/components/schemas/CreateAdLeadFormResponseDto
{
"type": "object",
"properties": {
"form": {
"$ref": "#/components/schemas/CreatedAdLeadFormDto"
}
},
"required": [
"form"
]
}CreatedAdLeadFormDto
#/components/schemas/CreatedAdLeadFormDto
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[1-9]\\d{0,19}$"
},
"name": {
"type": "string",
"description": "The name the form was created with. ECHOED from the request when the platform does not return one -- this edge accepts no field selection, so a read-after-write is not available and a second call would double the operation's price."
}
},
"required": [
"id",
"name"
]
}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"
]
}