Skip to content

Lead schema

A campaign’s schema lists the fields you expect in each lead payload. Pingdex validates submitted payloads against it before accepting the lead.

The schema is an array of up to 100 field definitions. Each definition has three properties:

Property Type Rules
name string Must match the pattern ^[A-Za-z_][A-Za-z0-9_]*$, up to 64 characters. Unique within the schema.
type string One of string, integer, number or boolean.
required boolean Whether the field must be present in every payload.
{
"schema": [
{ "name": "email", "type": "string", "required": true },
{ "name": "postcode", "type": "string", "required": true },
{ "name": "monthly_budget", "type": "number", "required": false },
{ "name": "number_of_bedrooms", "type": "integer", "required": false },
{ "name": "marketing_consent", "type": "boolean", "required": true }
]
}

Names must start with a letter or underscore and then use only letters, digits and underscores. For example, postcode, _source and bedrooms_2 are valid. home-phone, 2nd_car and post code are not.

Type Accepts
string Text values.
integer Whole numbers.
number Any numeric value, including decimals.
boolean true or false.

If the schema is empty, the campaign accepts any JSON object as a payload. This is useful while you are exploring a new campaign, but it means Pingdex cannot catch missing or mistyped fields for you. Fields that your providers’ request mappings depend on are best listed as required.

Only the fields listed in the schema are validated. Keys that are not in the schema are accepted and stored with the lead.

For example, with the schema above, this payload is valid even though utm_campaign is not listed:

{
"email": "sam.example@example.com",
"postcode": "XX1 1XX",
"marketing_consent": true,
"utm_campaign": "spring-offer"
}