Field reference
GET /v1/leads/fields — every field POST accepts, with limits and valid values, generated from the validator itself.
GET List fields
/v1/leads/fieldsDescribes every field create a lead accepts, keyed by the exact property name you send: type and limits for scalars, and the valid values for option fields. It is generated from the same definitions the validator uses, so it cannot disagree with what the API accepts. No parameters.
Fetch it once when your integration starts, and again when a POST comes back 422, rather than
hard-coding values. Cached for five minutes (Cache-Control: private, max-age=300). For a large
organisation the full response runs to a few hundred KB, most of it campaigns.
curl https://api.evacrm.co.uk/v1/leads/fields \
-H "Authorization: Bearer sk_..."{
"fields": {
"reference": { "type": "string", "required": true, "maxLength": 200 },
"email": { "type": "string", "maxLength": 255, "format": "email" },
"yearBuilt": { "type": "integer", "min": 1000, "max": 2200 },
"expectedCloseDate": { "type": "date" },
"marketingEmail": { "type": "boolean" },
"advancedData": { "type": "object" },
"leadType": {
"type": "option",
"options": [
{ "id": "3340ec93-2b79-4134-a2be-b5c890dd3f25", "name": "Repairs" },
{ "id": "0ef1e6df-6dcd-4e61-b8e4-6218257bcc0d", "name": "Conservatories" }
]
},
"leadProductTypes": { "type": "option", "multiple": true, "maxItems": 50, "options": [ "…" ] },
"marketing": {
"type": "option",
"options": [ { "id": "115f1cc5-…", "name": "Website" } ]
},
"subSourceCampaign": {
"type": "option",
"dependsOn": "marketing",
"options": [ { "id": "339b463f-…", "name": "2021/05 May", "marketing": "115f1cc5-…" } ]
},
"assignedTo": {
"type": "option",
"options": [ { "id": "cd9356b7-…", "name": "Tuan Dinh", "email": "tuan@example.com" } ]
},
"name": { "type": "string", "maxLength": 200, "deprecated": true, "replacedBy": ["firstName", "lastName"] }
},
"requirements": [
"reference",
"one of: firstName, lastName, companyName",
"one of: email, phoneNumber, mobile"
]
}Reading it
type | Extra keys | Send |
|---|---|---|
string | maxLength, required, format (email) | A string |
integer | min, max | A number, or a numeric string |
boolean | — | See booleans |
date | — | ISO 8601 |
object | — | Any JSON object |
option | options, multiple + maxItems, dependsOn | An option's id or name; an array of them when multiple |
optionsare the values valid for your organisation.title,country,leadTypeand the other CRM-wide lists are the same for everyone;marketing,subSourceCampaignandassignedToare yours, active ones only.subSourceCampaignoptions carry theidof theirmarketingsource, so a form can filter campaigns once a source is picked.dependsOnsays which field that is.leadProductTypesshares its list withmainInterest; that is how the CRM models it.deprecatedfields are the old webhook's names. They still work; new integrations should usereplacedBy.requirementsare the cross-field rules a single field cannot express.
GET Get a field
/v1/leads/fields/{field}One field, in the same shape, with field added.
fieldstringRequiredThe property name as you send it, such as subSourceCampaign or assignedTo.
curl https://api.evacrm.co.uk/v1/leads/fields/subSourceCampaign \
-H "Authorization: Bearer sk_..."{ "field": "subSourceCampaign", "type": "option", "dependsOn": "marketing", "options": [ "…" ] }