DealSleek API · Leads
PreviewDefine Lead Custom Field
Define a tenant custom lead field (key, label, kind, options, validators). Lets a customer capture something the platform does not ship, e.g. their own product name.
/api/v1/leads/dispatchHeaders
AuthorizationstringRequiredAccess token of the signed-in user, as a Bearer token. It identifies the user, their role and the workspace.
X-CQRS-ActionstringRequiredNames the command to run. Must be
DEFINE_LEAD_CUSTOM_FIELDfor this endpoint.Content-TypestringRequiredAlways
application/json.X-Idempotency-KeystringOptionalA key you choose that is unique to this attempt. A command repeated with the same key is not applied a second time.
X-Correlation-IdstringOptionalYour own identifier for the request. Returned in the
x-correlation-idresponse header; generated when you leave it out.
Request body
field_iduuidRequiredNo description yet.
field_kindenumRequiredNo description yet.
- Allowed values
- TEXT_INPUT
- TEXTAREA
- PHONE
- NUMBER
- CURRENCY
- PERCENTAGE
- DROPDOWN
- COMBOBOX
- MULTI_SELECT
- RADIO_GROUP
- CHECKBOX_GROUP
- TOGGLE_SWITCH
- DATE
- TIME
- DATE_TIME
- FILE_UPLOAD
- IMAGE_UPLOAD
- SIGNATURE
- READ_ONLY
- NESTED_FORM
- REPEATABLE_GROUP
- EDITABLE_TABLE
- ADDRESS_AUTOCOMPLETE
- MASKED_INPUT
- AI_PROMPT
- AI_EXTRACTED_FIELD
- DEAL_HEALTH_WIDGET
- CAUSAL_INTENT_WIDGET
- COGNITIVE_CAPACITY_BAR
- CRYO_STASIS_TRACKER
- COMMENT
- CONSENT_CHECKBOX
- SUMMARY_VIEW
- GRAPH_MAPPER
- REASONING_VIEWER
- DAG_CANVAS
- NODE_INSPECTOR_PANEL
keystringRequiredStorage key. Immutable once leads have answered it — renaming would orphan every stored value.
- minimum length 1
- maximum length 64
labelstringRequiredNo description yet.
- minimum length 1
- maximum length 120
tenant_iduuidRequiredNo description yet.
existing_field_countintegerOptionalFields the tenant already has, so the ceiling can be enforced without the executor reaching for the database.
- Default
- 0
- at least 0
help_textstring or nullOptionalNo description yet.
optionsarray of objectOptionalNo description yet.
2 child fields
labelstringRequiredNo description yet.
valuestringRequiredNo description yet.
placeholderstring or nullOptionalNo description yet.
requiredbooleanOptionalNo description yet.
- Default
- false
validatorsarray of objectOptionalNo description yet.
7 child fields
kindenumRequiredNo description yet.
- Allowed values
- url
- pattern
- min_length
- matches_field
- range
- greater_than_field
- greater_or_equal_field
- greater_than
- url
- Value must be a syntactically valid http(s) URL.
- pattern
- Value must match
pattern(a JS-compatible regular expression). - min_length
- String length must be ≥
value. - matches_field
- Value must equal the current value of another field in the same form (named by
field). The only CROSS-FIELD rule: every other kind judges a value in isolation, so "confirm password" could not be expressed and lived as hand-written logic in the register page instead — which is why its error surfaced as a page-level banner rather than at the input. - range
- Numeric value must fall within
min..=maxinclusive. - greater_than_field
- Numeric value must be greater than the current value of another field (named by
field). - greater_or_equal_field
- Numeric value must be greater than OR EQUAL TO another field's value.
- greater_than
- Numeric value must be strictly greater than the literal
value.
messageKeystringRequiredi18n key for the error shown when this rule fails.
fieldstring or nullOptionalPeer field name for
MatchesField/GreaterThanField. Unused by the value-in-isolation kinds.maxinteger or nullOptionalNo description yet.
mininteger or nullOptionalInclusive bounds for
Range. Unused by every other kind.patternstring or nullOptionalNo description yet.
valueinteger or nullOptionalNo description yet.
Response
Status 202. The command was applied. The body reports the outcome and, where the command changes a record, that record's new state.
successbooleanRequiredtruewhen the command was applied.error_messagestringRequiredEmpty when the command was applied.
projected_stateobjectOptionalThe record as it stands after the command.
event_payloadobjectOptionalThe event the command recorded.
insightsarray of objectOptionalAdvisory notes about the result. Each has a
code, amessageand animpactnumber.
Errors
Every error carries an HTTP status. Where it also carries a code, branch on the code, not on the message.
- 400
X-CQRS-Actionis missing or names a command this route does not accept. SendDEFINE_LEAD_CUSTOM_FIELD. - 400
DOMAIN_ROUTINGThe body is not a valid command. Check the required fields and their types. - 401The access token is missing, expired or not valid.
- 401
L1_AUTHThe caller's role is belowmanageror the caller has no access to this record. - 403
L1_POLICYA business rule refused the command. The message names the rule. - 409
L1_IDEMPOTENCYA command with this idempotency key was already applied. - 409
CONFLICTThe command would duplicate a record that must be unique. - 500
L3_COMMITThe command was valid but could not be saved.