The source event is created after all steps have been processed. It represents the outcome of lead processing from the perspective of the lead source. A source event records the below properties in addition to the event properties shown above.
Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.
The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.
The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ActiveProspect Developer Documentation","colors":{"primary":"#22a7f0","light":"#79caf6","dark":"#22a7f0"},"logo":{"light":"https://mintcdn.com/activeprospectinc/ttzTIJYOTNQPAJMy/logo/activeprospect_logo.svg?fit=max\u0026auto=format\u0026n=ttzTIJYOTNQPAJMy\u0026q=85\u0026s=9c7503c7631642aa1f7288ae35cc02cc","dark":"https://mintcdn.com/activeprospectinc/ttzTIJYOTNQPAJMy/logo/activeprospect_whiteblue.svg?fit=max\u0026auto=format\u0026n=ttzTIJYOTNQPAJMy\u0026q=85\u0026s=3df29616a4d6781de4873141e49ca8e0"},"favicon":"https://mintcdn.com/activeprospectinc/ybHg7UeILJeU2Jw-/favicon.png?fit=max\u0026auto=format\u0026n=ybHg7UeILJeU2Jw-\u0026q=85\u0026s=95060b05f4b73bb5ad4a373e19c17430","navbar":{"links":[{"href":"https://support.activeprospect.com/hc/en-us","label":"Support"}],"primary":{"type":"button","label":"Sign in to ActiveProspect","href":"https://account.activeprospect.com"}},"footer":{"socials":{"facebook":"https://www.facebook.com/activeprospect","x":"https://twitter.com/activeprospect","instagram":"https://www.instagram.com/activeprospectinc","linkedin":"https://www.linkedin.com/company/activeprospect","youtube":"https://www.youtube.com/channel/UCN_HLECy6KzYhFfIyLM50rQ","github":"https://github.com/activeprospect"},"links":[{"header":"Customers","items":[{"label":"Knowledge Base","href":"https://support.activeprospect.com/hc/en-us"},{"label":"Start Certifying your Leads","href":"https://account.activeprospect.com/register/trustedform/certify"},{"label":"Product What's New","href":"https://whatsnew.activeprospect.com/"},{"label":"Platform Status","href":"https://status.activeprospect.com/"},{"label":"Integrations","href":"https://activeprospect.com/integrations"},{"label":"Add-ons","href":"https://activeprospect.com/leadconduit/add-on-services"},{"label":"Support Plans","href":"https://activeprospect.com/support-plans"}]},{"header":"Resources","items":[{"label":"TrustedForm Cert Demo","href":"https://activeprospect.com/products/trustedform-demo"},{"label":"Talk to an Expert","href":"https://activeprospect.com/get-demo"},{"label":"Blog","href":"https://activeprospect.com/blog"},{"label":"InsideCBM","href":"https://activeprospect.com/inside-cbm"},{"label":"Glossary","href":"https://activeprospect.com/glossary"},{"label":"TCPA Compliance","href":"https://activeprospect.com/tcpa-compliance"},{"label":"Ping Pick Post","href":"https://activeprospect.com/ping-pick-post"}]},{"header":"Company","items":[{"label":"About Us","href":"https://activeprospect.com/about-us"},{"label":"Conferences and Events","href":"https://activeprospect.com/activeprospect-events"},{"label":"Careers","href":"https://activeprospect.com/careers"},{"label":"Security","href":"https://activeprospect.com/security"},{"label":"Security Information Portal","href":"https://security.activeprospect.com/"},{"label":"Contact Us","href":"https://activeprospect.com/contact-us"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://activeprospect.com/privacy-policy"},{"label":"TrustedForm Privacy Policy","href":"https://activeprospect.com/trustedform-privacy-notice"},{"label":"Privacy Notice for California Residents","href":"https://activeprospect.com/privacy-notice-california"},{"label":"Terms of Service","href":"https://activeprospect.com/terms-of-service"},{"label":"TrustedForm Certify EULA","href":"https://activeprospect.com/trustedform-eula"}]}]},"seo":{"metatags":{"canonical":"https://developers.activeprospect.com"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"activeprospectinc","hasAudioNarration":false,"actualSubdomain":"activeprospectinc","customDomains":["developers.activeprospect.com"],"gitSource":{"type":"github","owner":"activeprospect","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aea11512d9111c67b18d575","collectionId":"7533e224-8cf8-49b6-b7a8-e85a461a93bd","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aea11512d9111c67b18d575"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aea11512d9111c67b18d575","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"API Documentation","count":115},{"language":"default","tag":"LeadConduit","count":99},{"language":"default","tag":"API Endpoints","count":92},{"language":"default","tag":"TrustedForm","count":26},{"language":"default","tag":"Flows","count":18},{"language":"default","tag":"TrustedForm API 4.0","count":11},{"language":"default","tag":"Account","count":9},{"language":"default","tag":"Fields","count":9},{"language":"default","tag":"Caps and Limits","count":8},{"language":"default","tag":"Operations","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".black-headline{color:#000;font-weight:700;font-size:18px}.tfbody{border:1px solid #000;background-color:#9bcae3;font-family:\"proxima nova\",sans-serif;color:#131718;width:670px;margin:0 auto;padding:20px;font-size:18px}.tfbody input{background-color:#6fb3c1;display:block;margin:10px 0;padding:6px 0;font-size:14px}.tfbody input[type=checkbox]{display:inline}.tfbody input[type=email],.tfbody input[type=password],.tfbody textarea{color:#fff;min-width:90%}.tfbody input[type=text]{color:#fff;min-width:90%;width:200px}.tfbody a{color:#fff}.tfbody .consent_copy{margin:auto;width:80%}.tfbody .form_field_hldr_hldr{width:100%;padding:12px}.tfbody .form_field_hldr{width:44%;display:inline-block}.check-wrapper{padding:6px}#test-form{margin:auto}#consent_tag_target{color:#00008b;width:100%;text-align:center;margin:6px;height:2rem}.indentpar{display:inline}.indented{margin-left:22px;margin-top:-28px;line-height:22px}[data-tf-element-role=\"\"],[data-tf-element-role=consent-language],[data-tf-element-role=offer]{border:2px solid #9bcae3}[data-tf-element-role=offer]:hover{border:2px solid #ff0}[data-tf-element-role=consent-language]:hover{border:2px solid #adff2f}.consent-hilight>* [data-tf-element-role]:not([data-tf-element-role=offer]):not([data-tf-element-role=consent-language]){background-color:inherit;box-shadow:0 0 1px 1px #8a2be2}.consent-hilight>[data-tf-element-role]:not([data-tf-element-role=offer]):not([data-tf-element-role=consent-language]){background-color:#ff0!important;box-shadow:0 0 1px 1px #8a2be2}[data-tf-element-role]:not([data-tf-element-role=offer]):not([data-tf-element-role=consent-language]):hover{background-color:#ff0}"}],"page":{"pagePath":"api-reference/leadconduit/leads/event","slug":"/api-reference/leadconduit/leads/event","pageMetadata":{"openapi-schema":"Event","title":null,"description":null,"href":"/api-reference/leadconduit/leads/event"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi-schema":"Event","title":null,"description":null,"href":"/api-reference/leadconduit/leads/event"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"schemaData":{"oneOf":[{"type":"object","title":"Source Event","description":"The source event is created after all steps have been processed. It represents the outcome of lead processing from the perspective of the lead source. A source event records the below properties in addition to the event properties shown above.","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["success","failure","error"],"x-enumDescriptions":{"success":"The source was notified in the response that the lead was accepted","failure":"The source was notified in the response that the lead was rejected","error":"The source was notified in the response that an error occurred while processing the lead"},"isRequired":true,"uniqueKey":"oneOf.0.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"The reason for a failure or error outcome","isRequired":true,"uniqueKey":"oneOf.0.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a source submits a lead to a flow","enum":["source"],"isRequired":true,"uniqueKey":"oneOf.0.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Source Event Variables","description":"All data available at the time LeadConduit started processing this event\n","additionalProperties":false,"uniqueKey":"oneOf.0.vars","typeLabel":"Source Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.0.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.0.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.0.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.0.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.0.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.0.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.0.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.0.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.0.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.0.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.0.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.0.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.0.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.0.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.0.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.0.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting for all recipients to respond","uniqueKey":"oneOf.0.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.0.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.0.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted","uniqueKey":"oneOf.0.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.0.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.0.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.0.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.0.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.0.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.0.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.0.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.0.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.0.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.0.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.0.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.0.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.0.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.0.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.0.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.0.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.0.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.0.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.0.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.0.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.0.expires_at","typeLabel":"string\u003cdate-time>"},"module_id":{"title":"Integration Module ID","type":"string","description":"The integration module ID configured for the source","example":"leadconduit-salesforce.outbound.create_contact","uniqueKey":"oneOf.0.module_id","typeLabel":"string"},"package_version":{"type":"string","description":"The semantic version of the integration package","uniqueKey":"oneOf.0.package_version","typeLabel":"string"},"acceptance_criteria":{"title":"Acceptance Criteria","type":"object","properties":{"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"This rule set must pass in order for a lead to be accepted","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.0.acceptance_criteria.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.rule_set","typeLabel":"Rule Set · object"},"outcome":{"type":"string","description":"When the rule set fails, `success`, `failure` or `error` is returned to the source that submitted the lead","enum":["success","failure","error"],"example":"failure","isRequired":true,"uniqueKey":"oneOf.0.acceptance_criteria.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","title":"Template","description":"When the outcome is `failure`, this is the reason to provide to the source","x-tags":["Templates"],"example":"Lead must live in TX","uniqueKey":"oneOf.0.acceptance_criteria.reason","typeLabel":"string"}},"additionalProperties":false,"required":["outcome","rule_set"],"description":"The acceptance criteria configured on the source when the lead was processed","uniqueKey":"oneOf.0.acceptance_criteria","typeLabel":"Acceptance Criteria · object"},"step_count":{"type":"integer","description":"The number of steps processed for this lead (>= 0 and \u003c= total number of steps)","example":4,"uniqueKey":"oneOf.0.step_count","typeLabel":"integer"},"appended":{"type":"object","description":"All data appended while handing the lead","uniqueKey":"oneOf.0.appended","typeLabel":"object"},"request":{"type":"object","properties":{"method":{"type":"string","description":"HTTP request method","enum":["GET","POST","PUT","DELETE","PATCH","OPTIONS"],"example":"POST","isRequired":true,"uniqueKey":"oneOf.0.request.method","typeLabel":"enum\u003cstring>"},"uri":{"type":"string","description":"The full URI","format":"uri","example":"https://app.leadconduit.com/flows/5fd4371e940df5a34a3888b2/sources/6369a0e534c9d4ebe142e0ef/submit","isRequired":true,"uniqueKey":"oneOf.0.request.uri","typeLabel":"string\u003curi>"},"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.0.request.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent on the request","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.0.request.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the request body","example":"{\"email\":\"johndoe@email.com\",\"phone_1\":\"5127891111\"}","isRequired":true,"uniqueKey":"oneOf.0.request.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately prior to sending the request","isRequired":true,"uniqueKey":"oneOf.0.request.timestamp","typeLabel":"integer"}},"required":["method","uri","version","headers","body","timestamp"],"additionalProperties":false,"description":"The inbound HTTP request","uniqueKey":"oneOf.0.request","typeLabel":"object"},"response":{"type":"object","properties":{"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.0.response.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent in the response","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.0.response.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the response body","example":"{\"outcome\":\"success\",\"lead\":{\"id\":\"63cc6f0e55254d7d1c4c3037\"}}","isRequired":true,"uniqueKey":"oneOf.0.response.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately after reading the response body","isRequired":true,"uniqueKey":"oneOf.0.response.timestamp","typeLabel":"integer"},"status":{"type":"integer","description":"HTTP status code","example":201,"uniqueKey":"oneOf.0.response.status","typeLabel":"integer"},"status_text":{"type":"string","description":"The textual representation of the status","format":"uri","example":"Created","uniqueKey":"oneOf.0.response.status_text","typeLabel":"string\u003curi>"}},"required":["method","uri","version","headers","body","timestamp"],"description":"The inbound HTTP response","uniqueKey":"oneOf.0.response","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"Source Event · object"},{"type":"object","title":"Recipient Event","description":"When a lead is processed by a recipient step, the associated integration is resolved using\nthe `module_id` and invoked. The integration contacts the recipient's server and determines the `outcome` and `reason` \nfor the call. Different integrations determine outcome in different ways, so it's important to know what `success`\nor `failure` mean for a particular integration.\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["success","failure","error","skip"],"x-enumDescriptions":{"success":"The recipient accepted the lead","failure":"The recipient rejected the lead","error":"An error occurred while attempting to communicate with the recipient","skip":"The recipient step was skipped due to failure the rule set or cap having been met"},"isRequired":true,"uniqueKey":"oneOf.1.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"The reason for a failure or error outcome","isRequired":true,"uniqueKey":"oneOf.1.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a lead is sent to a recipient using a recipient step in a flow","enum":["recipient"],"isRequired":true,"uniqueKey":"oneOf.1.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Recipient Event Variables","description":"All data available at the time LeadConduit starts processing the recipient step. The following\nadditional data will be added to the vars for the purposes of processing this step.\n* `price` — The price to be paid to the recipient\n* `purchase_price` - The cost of the lead paid to the source\n* `event_id` - The identifier of this event (so it can be sent to the recipient for feedback)\n* `recipient` — The `id` and `name` of the recipient\n","properties":{"price":{"type":"number","description":"The price to be paid to the recipient","uniqueKey":"oneOf.1.vars.price","typeLabel":"number"},"purchase_price":{"type":"number","description":"The cost of the lead paid to the source","uniqueKey":"oneOf.1.vars.purchase_price","typeLabel":"number"},"event_id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"636999a5a28de89048cd16fc","uniqueKey":"oneOf.1.vars.event_id","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"oneOf.1.vars","typeLabel":"Recipient Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.1.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.1.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.1.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.1.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.1.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.1.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.1.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.1.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.1.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.1.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.1.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.1.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.1.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.1.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.1.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.1.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting the recipient to respond","uniqueKey":"oneOf.1.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.1.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.1.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted ","uniqueKey":"oneOf.1.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.1.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.1.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.1.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.1.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.1.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.1.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.1.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.1.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.1.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.1.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.1.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.1.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.1.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.1.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.1.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.1.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.1.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.1.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.1.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.1.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.1.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.metadata","typeLabel":"Metadata · object | null"},"step_id":{"type":"string","description":"The id of the step in the flow associated with this event","uniqueKey":"oneOf.1.step_id","typeLabel":"string"},"caps":{"oneOf":[{"type":"null","description":"A cap controls the behavior by setting the maximum and the duration. The counter for a cap is kept as a standalone record which shares cap's ID.\n","uniqueKey":"oneOf.1.caps.oneOf.0","typeLabel":"null"},{"type":"array","items":{"x-tags":["Caps and Limits"],"type":"object","description":"A cap allows limiting the number of leads sent into or out of a flow. \nIf a lead is successful, it will be counted against the maximum configured leads. \nIf configured, the rule set will be evaluated to determine whether a lead will be counted against the cap.\n","properties":{"id":{"type":"string","description":"The unique identifier of the cap","pattern":"^[0-9a-fA-F]{24}$","example":"5fd438f91f0d12766e2bfee5","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"The type of this cap (LeadConduit may eventually support different types of caps)","enum":["volume"],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"name":{"description":"The human-readable name of the cap","type":"string","example":"Monthly leads from TX","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].name","typeLabel":"string"},"maximum":{"type":"number","description":"The number of successful leads that will be accepted","example":1200,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].maximum","typeLabel":"number"},"duration":{"type":"number","description":"The number duration_units for which the cap persists","minimum":1,"examples":[1],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].duration","typeLabel":"number"},"duration_units":{"type":"string","description":"The unit of time for which the cap persists","enum":["month","week","day","hour","minute"],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].duration_units","typeLabel":"enum\u003cstring>"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"This rule set must pass in order for the lead to count against the cap","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].rule_set","typeLabel":"Rule Set · object"},"caps":{"description":"Nested caps evaluated if rules for the parent cap pass","type":"array","items":{"$circularRef":"a0504bde-eae4-48cd-8488-ce131a7ae199"},"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].caps","typeLabel":"array"},"time_zone":{"description":"The time zone in which cap resets","type":"string","example":"America/New_York","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].time_zone","typeLabel":"string"},"reason":{"type":"string","title":"Template","description":"When the cap is met this is the reason (default: 'Cap reached')","x-tags":["Templates"],"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].reason","typeLabel":"string"},"created_at":{"description":"Read-only time the cap was created","type":"string","format":"date-time","example":"2020-11-23T11:41:52Z","uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX].created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.1.caps.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"A cap controls the behavior by setting the maximum and the duration. The counter for a cap is kept as a standalone record which shares cap's ID.\n","minItems":1,"uniqueKey":"oneOf.1.caps.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"oneOf.1.caps","typeLabel":"null | object[]"},"caps_reached":{"type":"boolean","description":"One or more of the recipient caps were met","uniqueKey":"oneOf.1.caps_reached","typeLabel":"boolean"},"key":{"type":"string","description":"The property name on the event where appended data is stored","uniqueKey":"oneOf.1.key","typeLabel":"string"},"cost":{"type":"number","format":"double","description":"The amount paid for the purchase of this lead","uniqueKey":"oneOf.1.cost","typeLabel":"number\u003cdouble>"},"purchase_price":{"type":"number","format":"double","description":"The amount paid for the purchase of this lead","uniqueKey":"oneOf.1.purchase_price","typeLabel":"number\u003cdouble>"},"sale_price":{"type":"number","format":"double","description":"The revenue received for the sale of this lead","uniqueKey":"oneOf.1.sale_price","typeLabel":"number\u003cdouble>"},"revenue":{"type":"number","format":"double","description":"The difference between the purchase price and the sale price","uniqueKey":"oneOf.1.revenue","typeLabel":"number\u003cdouble>"},"module_id":{"title":"Integration Module ID","type":"string","description":"The unique identifier of the integration module","example":"leadconduit-salesforce.outbound.create_contact","uniqueKey":"oneOf.1.module_id","typeLabel":"string"},"credential":{"oneOf":[{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","username","password"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["user"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.type","typeLabel":"enum\u003cstring>"},"username":{"description":"The username to use for basic authentication","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.username","typeLabel":"string"},"password":{"description":"The password to use for basic authentication","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.0.password","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.0.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.0.updated_at","typeLabel":"string\u003cdate-time>"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.0","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.1.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.1.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.1.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["token"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.1.type","typeLabel":"enum\u003cstring>"},"token":{"description":"The access token to use with type token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.1.token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.1.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.1.updated_at","typeLabel":"string\u003cdate-time>"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.1","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","consumer_key","consumer_secret","token_key","access_token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["oauth1"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.type","typeLabel":"enum\u003cstring>"},"consumer_key":{"description":"The OAuth 1.0 consumer key","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.consumer_key","typeLabel":"string"},"consumer_secret":{"description":"The OAuth 1.0 consumer secret","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.consumer_secret","typeLabel":"string"},"token_key":{"description":"The OAuth 1.0 token key","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.token_key","typeLabel":"string"},"access_token":{"description":"The OAuth 1.0 access token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.2.access_token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.2.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.2.updated_at","typeLabel":"string\u003cdate-time>"},"realm":{"description":"The OAuth 1.0 realm","type":"string","uniqueKey":"oneOf.1.credential.oneOf.2.realm","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.2","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","access_token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.3.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.3.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.3.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["oauth2"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.3.type","typeLabel":"enum\u003cstring>"},"access_token":{"description":"The OAuth 2.0 access token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.3.access_token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.3.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.3.updated_at","typeLabel":"string\u003cdate-time>"},"refresh_token":{"description":"The OAuth 2.0 refresh token used to obtain a new access token","type":"string","minLength":1,"uniqueKey":"oneOf.1.credential.oneOf.3.refresh_token","typeLabel":"string"},"expires_at":{"description":"The time in epoch milliseconds at which the access token will expire","type":"integer","format":"int64","uniqueKey":"oneOf.1.credential.oneOf.3.expires_at","typeLabel":"integer\u003cint64>"},"environment":{"description":"The environment for the OAuth connection (e.g. production, sandbox)","type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.environment","typeLabel":"string"},"user":{"description":"The user the credential belongs to","type":"object","properties":{"id":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.id","typeLabel":"string"},"username":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.username","typeLabel":"string"},"first_name":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.first_name","typeLabel":"string"},"last_name":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.last_name","typeLabel":"string"},"email":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.email","typeLabel":"string"},"phone":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.user.phone","typeLabel":"string"}},"uniqueKey":"oneOf.1.credential.oneOf.3.user","typeLabel":"object"},"org":{"description":"The organization the credential belongs to","type":"object","properties":{"id":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.org.id","typeLabel":"string"},"type":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.org.type","typeLabel":"string"},"name":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.org.name","typeLabel":"string"},"prefix":{"type":"string","uniqueKey":"oneOf.1.credential.oneOf.3.org.prefix","typeLabel":"string"}},"uniqueKey":"oneOf.1.credential.oneOf.3.org","typeLabel":"object"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.3","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.4.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.4.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.4.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["integration_platform_credential"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.4.type","typeLabel":"enum\u003cstring>"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.4.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.4.updated_at","typeLabel":"string\u003cdate-time>"},"instance_id":{"description":"The Integration Platform app instance this credential belongs to","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.instance_id","typeLabel":"string"},"connection_instance_id":{"description":"The Integration Platform connection instance this credential belongs to","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.connection_instance_id","typeLabel":"string"},"marketplace_app_id":{"description":"The marketplace app this credential was created for","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.marketplace_app_id","typeLabel":"string"},"callback_url":{"description":"The LeadConduit URL the app posts leads to","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.callback_url","typeLabel":"string"},"signing_secret":{"description":"The HMAC key used to verify inbound webhooks. Returned once by create and update, then omitted from list, show, and delete responses.","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.signing_secret","typeLabel":"string"},"flow_id":{"description":"The flow this credential was bound to at flow-save time","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.flow_id","typeLabel":"string"},"callback_id":{"description":"The callback this credential was bound to at flow-save time","type":"string","uniqueKey":"oneOf.1.credential.oneOf.4.callback_id","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.4","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","access_key_id","secret_access_key"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["aws_sigv4"],"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.type","typeLabel":"enum\u003cstring>"},"access_key_id":{"description":"The AWS access key ID used to sign requests","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.access_key_id","typeLabel":"string"},"secret_access_key":{"description":"The AWS secret access key used to sign requests. Returned once by create and update, then omitted from list, show, and delete responses.","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.credential.oneOf.5.secret_access_key","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.5.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.1.credential.oneOf.5.updated_at","typeLabel":"string\u003cdate-time>"},"region":{"description":"The AWS region the signature is scoped to, for example `us-west-2`. Optional: when\nabsent, the region is derived from the endpoint hostname, which is correct for an\n`execute-api.\u003cregion>.amazonaws.com` URL. Set it for a custom domain, where nothing\ncan be derived and signing falls back to `us-east-1` — which produces an opaque 403\nrather than an error. An explicit region overrides the hostname, so a value that\ndisagrees with the URL will break signing.\n","type":"string","minLength":1,"uniqueKey":"oneOf.1.credential.oneOf.5.region","typeLabel":"string"},"service":{"description":"The AWS service the signature is scoped to, for example `execute-api` for API\nGateway or `s3` for S3. Optional: when absent, the service is derived from the\nendpoint hostname, and a custom domain falls back to `execute-api`, because a\nhostname that encodes no service yields an empty scope segment that AWS rejects.\n","type":"string","minLength":1,"uniqueKey":"oneOf.1.credential.oneOf.5.service","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.1.credential.oneOf.5","typeLabel":"object"}],"uniqueKey":"oneOf.1.credential","typeLabel":"object"},"credential_updated":{"type":"boolean","description":"Whether the credential used by the integration was refreshed","uniqueKey":"oneOf.1.credential_updated","typeLabel":"boolean"},"package_version":{"type":"string","description":"A \u003ca href=\"http://semver.org\" target=\"_blank\">semantic version\u003c/a>","uniqueKey":"oneOf.1.package_version","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"The rule set configured on the recipient step when the lead was processed ","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.1.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.1.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.1.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.1.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.1.rule_set","typeLabel":"Rule Set · object"},"mappings":{"type":"array","description":"The mappings applied while invoking the integration","items":{"description":"Mappings transform data between systems using rule-based translations. They handle field renaming, data restructuring, and conditional transformations for both inbound (sources) and outbound (recipients) data.\n\n## Core Structure\n\nEach mapping has three components:\n1. **Property**: Destination field name\n2. **Value**: Template-based value assignment\n3. **Rule Set**: Optional conditions for application\n\n```json\n{\n \"property\": \"full_name\",\n \"value\": \"{{lead.first_name}} {{lead.last_name}}\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [{\"lhv\": \"lead.state\", \"op\": \"is equal to\", \"rhv\": \"TX\"}]\n }\n}\n```\n\n## Inbound vs Outbound Mapping\n\n### Inbound Mapping (Source → LeadConduit)\n**Purpose**: Standardize field names during lead submission\n**Context**: Raw submission data before the lead object exists\n**Use Case**: Only needed when source field names don't match LeadConduit standards\n\n**Technical Detail**: Inbound mappings execute in the handler before the lead object is created. Templates can only reference raw submission fields (not `lead.field` syntax). The `lead.` prefix in properties tells the system to assign values to the lead object that will be created after mapping.\n\n```json\n// Source sends non-standard names\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_addr}}\"}\n]\n```\n\n**Key Rules**:\n- Use exact source field names in value templates (no `lead.` prefix)\n- Use LeadConduit field IDs in property templates (with `lead.` prefix)\n- Don't transform data - let type system handle normalization\n- Field renaming only\n\n### Outbound Mapping (LeadConduit → Recipient)\n**Purpose**: Transform processed data for recipient requirements\n**Context**: Complete lead data with all type components, all appended data\n**Use Case**: Format data, combine fields, extract components\n\n```json\n[\n {\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"},\n {\"property\": \"FormattedPhone\", \"value\": \"({{lead.phone_1.area}}) {{lead.phone_1.exchange}}-{{lead.phone_1.line}}\"},\n {\"property\": \"EmailDomain\", \"value\": \"{{lead.email.domain}}\"}\n]\n```\n\n**Key Rules**:\n- Use LeadConduit field IDs in templates\n- Leverage field value's components provided by the field's type\n- Transform data for recipient needs\n- Use conditional logic for business rules\n\n## Property Path Syntax\n\n**Simple**: `\"email\"`\n**Nested**: `\"contact.primary.email\"` → `{contact: {primary: {email: \"value\"}}}`\n**Arrays**: `\"phones.0\"` → `{phones: [\"value\"]}`\n**Special Keys**: `\"data{2024}.revenue\"` → `{data: {\"2024\": {revenue: \"value\"}}}`\n\n## Template Features\n\n**Field Access**: `{{lead.email}}`\n**Components**: `{{lead.phone_1.area}}`\n**Formatting**: `{{format lead.dob format=\"MM/DD/YYYY\"}}`\n**Calculations**: `{{math lead.loan_amount * 1.05}}`\n**Combinations**: `{{lead.first_name}} {{lead.last_name}}`\n\n## Common Patterns\n\n**Basic Field Renaming (Inbound)**:\n```json\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_address}}\"}\n]\n```\n\n**Field Combining (Outbound)**:\n```json\n{\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"}\n```\n\n**Conditional Fields**:\n```json\n{\n \"property\": \"premium_lead\",\n \"value\": \"true\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [\n {\"lhv\": \"lead.annual_income\", \"op\": \"is greater than\", \"rhv\": \"100000\"}\n ]\n }\n}\n```\n\n**Static Field Value**:\n```json\n{\n \"property\": \"aff_id\",\n \"value\": \"aff-103331\",\n}\n```\n\n**Nested Structures**:\n```json\n[\n {\"property\": \"applicant.name.first\", \"value\": \"{{lead.first_name}}\"},\n {\"property\": \"applicant.contact.email\", \"value\": \"{{lead.email}}\"}\n]\n```\n\n**Conditional Field Value Based on Precedence**:\n```json\n[\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_2}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_2.valid\", \"op\": \"is true\"}]}\n },\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_1}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_1.valid\", \"op\": \"is true\"}]}\n }\n]\n```\n\n## Special Behaviors\n\n**Processing Order**: Mappings apply sequentially, allowing overwrites\n**Empty Values**: Template results that are empty are skipped; explicit empty strings are applied\n**Type Preservation**: Simple variable templates preserve data types; string concatenation converts to string\n**Error Recovery**: Individual mapping failures don't stop processing\n\n## Best Practices\n\n**Inbound**: Only map fields with different names; let type system handle normalization; use simple templates\n**Outbound**: Use type components instead of string parsing; make property names self-documenting; test edge cases\n**Performance**: Order rules efficiently; minimize complex templates; group related mappings\n\n## Common Pitfalls\n\n### Pitfall: Transforming on Inbound\n❌ **Wrong**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{lowercase email_address}}\" // Don't do this!\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{email_address}}\" // Type system handles lowercasing\n}\n```\n\n### Pitfall: Using Wrong Field Names\n❌ **Wrong**:\n```json\n// In outbound mapping:\n{\n \"value\": \"{{lead.phone_1.area}}\" // Backend syntax\n}\n```\n✅ **Right**:\n```json\n{\n \"value\": \"{{Phone 1 > Area}}\" // UI display name with component\n}\n```\n\n### Pitfall: Over-Mapping\n❌ **Wrong**: Mapping fields that already match\n```json\n// If source sends \"email\", don't do this:\n{ \"property\": \"lead.email\", \"value\": \"{{email}}\" } // Unnecessary!\n```\n✅ **Right**: Only map when names differ\n\n### Pitfall: String Manipulation Instead of Components\n❌ **Wrong**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{substring Phone 1 start=1 end=4}}\"\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{Phone 1 > Area}}\"\n}\n```\n\n## Integration\n\n**With Types**: Inbound mappings happen before type conversion, outbound after\n**With Rules**: Control when mappings apply based on business logic\n**With Templates**: Provide dynamic values from lead data and components","type":"object","properties":{"property":{"description":"The name of the variable to set","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].property","typeLabel":"string"},"value":{"oneOf":[{"type":"string","title":"Template","description":"The value to set","x-tags":["Templates"],"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.1","typeLabel":"number"},{"type":"null","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.2","typeLabel":"null"},{"type":"array","items":{"oneOf":[{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.3.items.[INDEX]","typeLabel":"string | null"},"description":"The value to set","minItems":1,"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].value.oneOf.3","typeLabel":"(string | null)[]"}],"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].value","typeLabel":"string | number | null | (string | null)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this mapping","uniqueKey":"oneOf.1.mappings.items.[INDEX].id","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"Only apply the mapping if this rule set passes","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.1.mappings.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["property","value"],"uniqueKey":"oneOf.1.mappings.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.1.mappings","typeLabel":"object[]"},"pricing":{"description":"The pricing configuration applied to this recipient","type":"object","properties":{"override":{"description":"Allows a source or a recipient to specify the price rather than\nrelying on `prices`\n","type":"boolean","uniqueKey":"oneOf.1.pricing.override","typeLabel":"boolean"},"prices":{"description":"The list of prices to evaluate for each lead","type":"array","items":{"description":"A price determines the `purchase_price` or `sale_price` for a lead. If\nall rules in the `rule_set` pass, then the appropriate price property\nwill be set equal to the `amount`. When more than one price is\nspecified, the last matching price will be used to set the price\nproperty on the event.\n","type":"object","properties":{"amount":{"description":"The price of the lead in USD","type":"number","exclusiveMinimum":0,"isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].amount","typeLabel":"number"},"id":{"$circularRef":"5d3151ea-7285-4faa-9e58-f06d41c57a09","description":"ID of this price (matches the ID of the corresponding price configuration)\n","uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].id","typeLabel":"any"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"The rule set which must pass in order for this price to be\nconsidered\n","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"required":["amount"],"additionalProperties":false,"uniqueKey":"oneOf.1.pricing.prices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.1.pricing.prices","typeLabel":"object[]"}},"additionalProperties":false,"uniqueKey":"oneOf.1.pricing","typeLabel":"object"},"transactions":{"type":"array","description":"A list of HTTP transactions that occurred while processing the lead","items":{"type":"object","description":"An HTTP transaction initiated by the integration","properties":{"request":{"type":"object","properties":{"method":{"type":"string","description":"HTTP request method","enum":["GET","POST","PUT","DELETE","PATCH","OPTIONS"],"example":"POST","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.method","typeLabel":"enum\u003cstring>"},"uri":{"type":"string","description":"The full URI","format":"uri","example":"https://app.leadconduit.com/flows/5fd4371e940df5a34a3888b2/sources/6369a0e534c9d4ebe142e0ef/submit","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.uri","typeLabel":"string\u003curi>"},"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent on the request","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the request body","example":"{\"email\":\"johndoe@email.com\",\"phone_1\":\"5127891111\"}","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately prior to sending the request","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request.timestamp","typeLabel":"integer"}},"required":["method","uri","version","headers","body","timestamp"],"additionalProperties":false,"description":"An HTTP request sent by the integration","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].request","typeLabel":"object"},"response":{"type":"object","properties":{"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent in the response","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the response body","example":"{\"outcome\":\"success\",\"lead\":{\"id\":\"63cc6f0e55254d7d1c4c3037\"}}","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately after reading the response body","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response.timestamp","typeLabel":"integer"},"status":{"type":"integer","description":"HTTP status code","example":201,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response.status","typeLabel":"integer"},"status_text":{"type":"string","description":"The textual representation of the status","format":"uri","example":"Created","uniqueKey":"oneOf.1.transactions.items.[INDEX].response.status_text","typeLabel":"string\u003curi>"}},"required":["method","uri","version","headers","body","timestamp"],"description":"An HTTP response received by the integration","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].response","typeLabel":"object"},"ms":{"type":"integer","description":"The number of milliseconds that elapsed between sending request and receiving the response","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].ms","typeLabel":"integer"}},"required":["request","response","ms"],"uniqueKey":"oneOf.1.transactions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.1.transactions","typeLabel":"object[]"}},"uniqueKey":"oneOf.1","typeLabel":"Recipient Event · object"},{"type":"object","title":"Filter Event","description":"A filter event is created when a lead is processed by a filter step.\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.2.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["continue","stop","error"],"x-enumDescriptions":{"success":"The filter's rule set did not match the lead, and the flow continued","failure":"The filter's rule set matched the lead, and the flow stopped","error":"An unhandled error occurred while processing the filter step (this indicates a problem with LeadConduit)"},"isRequired":true,"uniqueKey":"oneOf.2.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"Set by evaluating the `reason` template of the filter step.","isRequired":true,"uniqueKey":"oneOf.2.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a filter step in a flow is processed","enum":["filter"],"isRequired":true,"uniqueKey":"oneOf.2.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Filter Event Variables","description":"All data available at the time LeadConduit started processing this event\n","additionalProperties":false,"uniqueKey":"oneOf.2.vars","typeLabel":"Filter Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.2.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.2.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.2.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.2.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.2.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.2.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.2.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.2.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.2.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.2.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.2.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.2.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.2.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.2.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.2.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.2.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting for all recipients to respond","uniqueKey":"oneOf.2.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.2.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.2.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted","uniqueKey":"oneOf.2.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.2.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.2.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.2.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.2.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.2.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.2.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.2.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.2.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.2.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.2.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.2.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.2.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.2.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.2.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.2.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.2.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.2.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.2.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.2.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.2.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.2.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.2.metadata","typeLabel":"Metadata · object | null"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"The rule set configured on the recipient step when the lead was processed","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.2.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.2.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.2.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.2.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.2.rule_set","typeLabel":"Rule Set · object"}},"uniqueKey":"oneOf.2","typeLabel":"Filter Event · object"},{"type":"object","title":"Calculated Event","description":"A calculated event is created when a lead is processed by a calculated fields step.\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.3.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["continue"],"x-enumDescriptions":{"continue":"The calculated fields step completed and the flow continued"},"isRequired":true,"uniqueKey":"oneOf.3.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"Always null for calculated events","isRequired":true,"uniqueKey":"oneOf.3.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a calculated fields step in a flow is processed","enum":["calculated"],"isRequired":true,"uniqueKey":"oneOf.3.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Filter Event Variables","description":"All data available at the time LeadConduit started processing this event\n","additionalProperties":false,"uniqueKey":"oneOf.3.vars","typeLabel":"Filter Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.3.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.3.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.3.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.3.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.3.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.3.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.3.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.3.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.3.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.3.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.3.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.3.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.3.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.3.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.3.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.3.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting for all recipients to respond","uniqueKey":"oneOf.3.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.3.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.3.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted","uniqueKey":"oneOf.3.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.3.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.3.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.3.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.3.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.3.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.3.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.3.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.3.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.3.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.3.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.3.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.3.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.3.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.3.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.3.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.3.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.3.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.3.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.3.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.3.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.3.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.3.metadata","typeLabel":"Metadata · object | null"},"step_id":{"type":"string","description":"The id of the step in the flow associated with this event","uniqueKey":"oneOf.3.step_id","typeLabel":"string"},"description":{"type":"string","description":"The description configured on the calculated fields step","uniqueKey":"oneOf.3.description","typeLabel":"string"},"fields":{"type":"array","description":"The calculated fields configured on the step when the lead was processed","items":{"type":"object","properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].name","typeLabel":"string"},"type":{"type":"string","enum":["number","string"],"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].id","typeLabel":"string"},"value":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].value","typeLabel":"string"},"rule_set":{"oneOf":[{"type":"object","title":"Rule Set","description":"A rule set is a collection of rules to evaluate. The `op` property determines whether all rules must pass (`and`) or just one of them must pass (`or`) in order for the rule set to be considered passing.\n","required":["op","rules"],"x-tags":["Rules"],"properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0.id","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.0","typeLabel":"Rule Set · object"},{"type":"null","uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX].rule_set","typeLabel":"Rule Set · object | null"}},"required":["id","value"],"uniqueKey":"oneOf.3.fields.items.[INDEX].rules.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].rules","typeLabel":"object[]"},"fallback":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].fallback.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].fallback.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.3.fields.items.[INDEX].fallback","typeLabel":"string | null"}},"required":["id","name","type","rules","fallback"],"uniqueKey":"oneOf.3.fields.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.3.fields","typeLabel":"object[]"},"results":{"type":"array","description":"The result of evaluating each configured calculated field","items":{"type":"object","properties":{"field_id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].field_id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].name","typeLabel":"string"},"rule_id":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].rule_id.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].rule_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].rule_id","typeLabel":"string | null"},"fallback":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].fallback","typeLabel":"boolean"},"value":{"description":"The computed value for the field, normalized by leadconduit-types","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].value","typeLabel":"any"},"errors":{"type":"array","items":{"type":"object","properties":{"rule_id":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].errors.items.[INDEX].rule_id.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].errors.items.[INDEX].rule_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].errors.items.[INDEX].rule_id","typeLabel":"string | null"},"reason":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].errors.items.[INDEX].reason","typeLabel":"string"}},"required":["rule_id","reason"],"uniqueKey":"oneOf.3.results.items.[INDEX].errors.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.3.results.items.[INDEX].errors","typeLabel":"object[]"}},"required":["field_id","name","rule_id","fallback","value","errors"],"uniqueKey":"oneOf.3.results.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.3.results","typeLabel":"object[]"},"calculated":{"type":"object","description":"The values set by the step, keyed by sanitized field name","additionalProperties":true,"uniqueKey":"oneOf.3.calculated","typeLabel":"object"}},"uniqueKey":"oneOf.3","typeLabel":"Calculated Event · object"},{"type":"object","title":"Feedback Received Event","description":"A feedback-received event is created when lead feedback is provided by a recipient. The feedback configuration must be\nprovided on the recipient step. When feedback is received, all variables are copied from the original recipient event.\n\nWhen feedback is configured to be sent to the source, the feedback-received event's `outcome` and `reason` are copied\nfrom the feedback-sent event. In other words, if the source refuses the feedback, the recipient will receive a \"failure\"\noutcome in response to the feedback call.\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.4.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["success","failure","error"],"x-enumDescriptions":{"success":"The recipient was notified in the response that the feedback was accepted","failure":"The recipient was notified in the response that the feedback was rejected","error":"The recipient was notified in the response that an error occurred while processing the feedback"},"isRequired":true,"uniqueKey":"oneOf.4.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"The reason for a failure or error outcome","isRequired":true,"uniqueKey":"oneOf.4.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a recipient provides feedback on a lead previously sent with a recipient step","enum":["feedback-received"],"isRequired":true,"uniqueKey":"oneOf.4.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Feedback Event Variables","description":"All variables from the most recent event for the lead receiving feedback. Additionally contains\nfeedback metadata at `feedback.`.\n","additionalProperties":false,"uniqueKey":"oneOf.4.vars","typeLabel":"Feedback Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.4.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.4.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.4.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.4.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.4.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.4.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.4.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.4.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.4.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.4.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.4.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.4.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.4.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.4.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.4.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.4.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting for all recipients to respond","uniqueKey":"oneOf.4.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.4.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.4.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted","uniqueKey":"oneOf.4.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.4.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.4.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.4.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.4.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.4.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.4.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.4.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.4.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.4.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.4.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.4.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.4.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.4.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.4.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.4.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.4.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.4.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.4.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.4.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.4.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.4.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.metadata","typeLabel":"Metadata · object | null"},"module_id":{"title":"Integration Module ID","type":"string","description":"The integration module ID configured for the recipient","example":"leadconduit-salesforce.outbound.create_contact","uniqueKey":"oneOf.4.module_id","typeLabel":"string"},"recipient_event_id":{"type":"string","description":"The ID of the recipient event used to provide the feedback","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.4.recipient_event_id","typeLabel":"string"},"step_id":{"type":"string","description":"The ID flow step that originally sent the lead to the recipient","uniqueKey":"oneOf.4.step_id","typeLabel":"string"},"feedback":{"description":"Feedback specifies the configuration for receiving and sending feedback\nabout a lead. When receiving feedback from a recipient, the `rule_set`\nmust pass. If it does not, a \"failure\" Feedback Received Event is\ncreated. When sending feedback to a source, the `rule_set` must pass. If\nit does not, a \" skip\" Feedback Sent Event is created.\n","properties":{"integration":{"type":"object","properties":{"module_id":{"title":"Integration Module ID","type":"string","description":"A pointer to the integration code to use for this integration\n","example":"leadconduit-salesforce.outbound.create_contact","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.module_id","typeLabel":"string"},"mappings":{"oneOf":[{"type":"array","items":{"description":"Mappings transform data between systems using rule-based translations. They handle field renaming, data restructuring, and conditional transformations for both inbound (sources) and outbound (recipients) data.\n\n## Core Structure\n\nEach mapping has three components:\n1. **Property**: Destination field name\n2. **Value**: Template-based value assignment\n3. **Rule Set**: Optional conditions for application\n\n```json\n{\n \"property\": \"full_name\",\n \"value\": \"{{lead.first_name}} {{lead.last_name}}\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [{\"lhv\": \"lead.state\", \"op\": \"is equal to\", \"rhv\": \"TX\"}]\n }\n}\n```\n\n## Inbound vs Outbound Mapping\n\n### Inbound Mapping (Source → LeadConduit)\n**Purpose**: Standardize field names during lead submission\n**Context**: Raw submission data before the lead object exists\n**Use Case**: Only needed when source field names don't match LeadConduit standards\n\n**Technical Detail**: Inbound mappings execute in the handler before the lead object is created. Templates can only reference raw submission fields (not `lead.field` syntax). The `lead.` prefix in properties tells the system to assign values to the lead object that will be created after mapping.\n\n```json\n// Source sends non-standard names\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_addr}}\"}\n]\n```\n\n**Key Rules**:\n- Use exact source field names in value templates (no `lead.` prefix)\n- Use LeadConduit field IDs in property templates (with `lead.` prefix)\n- Don't transform data - let type system handle normalization\n- Field renaming only\n\n### Outbound Mapping (LeadConduit → Recipient)\n**Purpose**: Transform processed data for recipient requirements\n**Context**: Complete lead data with all type components, all appended data\n**Use Case**: Format data, combine fields, extract components\n\n```json\n[\n {\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"},\n {\"property\": \"FormattedPhone\", \"value\": \"({{lead.phone_1.area}}) {{lead.phone_1.exchange}}-{{lead.phone_1.line}}\"},\n {\"property\": \"EmailDomain\", \"value\": \"{{lead.email.domain}}\"}\n]\n```\n\n**Key Rules**:\n- Use LeadConduit field IDs in templates\n- Leverage field value's components provided by the field's type\n- Transform data for recipient needs\n- Use conditional logic for business rules\n\n## Property Path Syntax\n\n**Simple**: `\"email\"`\n**Nested**: `\"contact.primary.email\"` → `{contact: {primary: {email: \"value\"}}}`\n**Arrays**: `\"phones.0\"` → `{phones: [\"value\"]}`\n**Special Keys**: `\"data{2024}.revenue\"` → `{data: {\"2024\": {revenue: \"value\"}}}`\n\n## Template Features\n\n**Field Access**: `{{lead.email}}`\n**Components**: `{{lead.phone_1.area}}`\n**Formatting**: `{{format lead.dob format=\"MM/DD/YYYY\"}}`\n**Calculations**: `{{math lead.loan_amount * 1.05}}`\n**Combinations**: `{{lead.first_name}} {{lead.last_name}}`\n\n## Common Patterns\n\n**Basic Field Renaming (Inbound)**:\n```json\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_address}}\"}\n]\n```\n\n**Field Combining (Outbound)**:\n```json\n{\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"}\n```\n\n**Conditional Fields**:\n```json\n{\n \"property\": \"premium_lead\",\n \"value\": \"true\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [\n {\"lhv\": \"lead.annual_income\", \"op\": \"is greater than\", \"rhv\": \"100000\"}\n ]\n }\n}\n```\n\n**Static Field Value**:\n```json\n{\n \"property\": \"aff_id\",\n \"value\": \"aff-103331\",\n}\n```\n\n**Nested Structures**:\n```json\n[\n {\"property\": \"applicant.name.first\", \"value\": \"{{lead.first_name}}\"},\n {\"property\": \"applicant.contact.email\", \"value\": \"{{lead.email}}\"}\n]\n```\n\n**Conditional Field Value Based on Precedence**:\n```json\n[\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_2}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_2.valid\", \"op\": \"is true\"}]}\n },\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_1}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_1.valid\", \"op\": \"is true\"}]}\n }\n]\n```\n\n## Special Behaviors\n\n**Processing Order**: Mappings apply sequentially, allowing overwrites\n**Empty Values**: Template results that are empty are skipped; explicit empty strings are applied\n**Type Preservation**: Simple variable templates preserve data types; string concatenation converts to string\n**Error Recovery**: Individual mapping failures don't stop processing\n\n## Best Practices\n\n**Inbound**: Only map fields with different names; let type system handle normalization; use simple templates\n**Outbound**: Use type components instead of string parsing; make property names self-documenting; test edge cases\n**Performance**: Order rules efficiently; minimize complex templates; group related mappings\n\n## Common Pitfalls\n\n### Pitfall: Transforming on Inbound\n❌ **Wrong**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{lowercase email_address}}\" // Don't do this!\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{email_address}}\" // Type system handles lowercasing\n}\n```\n\n### Pitfall: Using Wrong Field Names\n❌ **Wrong**:\n```json\n// In outbound mapping:\n{\n \"value\": \"{{lead.phone_1.area}}\" // Backend syntax\n}\n```\n✅ **Right**:\n```json\n{\n \"value\": \"{{Phone 1 > Area}}\" // UI display name with component\n}\n```\n\n### Pitfall: Over-Mapping\n❌ **Wrong**: Mapping fields that already match\n```json\n// If source sends \"email\", don't do this:\n{ \"property\": \"lead.email\", \"value\": \"{{email}}\" } // Unnecessary!\n```\n✅ **Right**: Only map when names differ\n\n### Pitfall: String Manipulation Instead of Components\n❌ **Wrong**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{substring Phone 1 start=1 end=4}}\"\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{Phone 1 > Area}}\"\n}\n```\n\n## Integration\n\n**With Types**: Inbound mappings happen before type conversion, outbound after\n**With Rules**: Control when mappings apply based on business logic\n**With Templates**: Provide dynamic values from lead data and components","type":"object","properties":{"property":{"description":"The name of the variable to set","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].property","typeLabel":"string"},"value":{"oneOf":[{"type":"string","title":"Template","description":"The value to set","x-tags":["Templates"],"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.1","typeLabel":"number"},{"type":"null","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.2","typeLabel":"null"},{"type":"array","items":{"oneOf":[{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX]","typeLabel":"string | null"},"description":"The value to set","minItems":1,"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3","typeLabel":"(string | null)[]"}],"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].value","typeLabel":"string | number | null | (string | null)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this mapping","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].id","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"Only apply the mapping if this rule set passes","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["property","value"],"uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The mappings to apply to lead data when interacting with this\nintegration\n","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"The mappings to apply to lead data when interacting with this\nintegration\n","uniqueKey":"oneOf.4.feedback.integration.mappings.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.integration.mappings","typeLabel":"object[] | null"}},"additionalProperties":false,"required":["module_id"],"description":"The integration to be used for the feedback","isRequired":true,"uniqueKey":"oneOf.4.feedback.integration","typeLabel":"object"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"If the rules fail the feedback is not performed","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.4.feedback.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.4.feedback.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.4.feedback.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.4.feedback.rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["integration"],"type":"object","uniqueKey":"oneOf.4.feedback","typeLabel":"object"},"request":{"type":"object","properties":{"method":{"type":"string","description":"HTTP request method","enum":["GET","POST","PUT","DELETE","PATCH","OPTIONS"],"example":"POST","isRequired":true,"uniqueKey":"oneOf.4.request.method","typeLabel":"enum\u003cstring>"},"uri":{"type":"string","description":"The full URI","format":"uri","example":"https://app.leadconduit.com/flows/5fd4371e940df5a34a3888b2/sources/6369a0e534c9d4ebe142e0ef/submit","isRequired":true,"uniqueKey":"oneOf.4.request.uri","typeLabel":"string\u003curi>"},"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.4.request.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent on the request","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.4.request.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the request body","example":"{\"email\":\"johndoe@email.com\",\"phone_1\":\"5127891111\"}","isRequired":true,"uniqueKey":"oneOf.4.request.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately prior to sending the request","isRequired":true,"uniqueKey":"oneOf.4.request.timestamp","typeLabel":"integer"}},"required":["method","uri","version","headers","body","timestamp"],"additionalProperties":false,"description":"The feedback HTTP request","uniqueKey":"oneOf.4.request","typeLabel":"object"},"response":{"type":"object","properties":{"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.4.response.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent in the response","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.4.response.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the response body","example":"{\"outcome\":\"success\",\"lead\":{\"id\":\"63cc6f0e55254d7d1c4c3037\"}}","isRequired":true,"uniqueKey":"oneOf.4.response.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately after reading the response body","isRequired":true,"uniqueKey":"oneOf.4.response.timestamp","typeLabel":"integer"},"status":{"type":"integer","description":"HTTP status code","example":201,"uniqueKey":"oneOf.4.response.status","typeLabel":"integer"},"status_text":{"type":"string","description":"The textual representation of the status","format":"uri","example":"Created","uniqueKey":"oneOf.4.response.status_text","typeLabel":"string\u003curi>"}},"required":["method","uri","version","headers","body","timestamp"],"description":"The feedback HTTP response","uniqueKey":"oneOf.4.response","typeLabel":"object"}},"uniqueKey":"oneOf.4","typeLabel":"Feedback Received Event · object"},{"type":"object","title":"Feedback Sent Event","description":"A feedback-sent event is created when lead feedback is sent to a source. The feedback configuration must be provided on\nthe source in the flow. When feedback is sent, all lead variables are copied from the original recipient event.\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.5.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["success","failure","error"],"x-enumDescriptions":{"success":"The source accepted the feedback","failure":"The source rejected the feedback","error":"An error occurred while attempting to communicate with the source"},"isRequired":true,"uniqueKey":"oneOf.5.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"The reason for a failure or error outcome","isRequired":true,"uniqueKey":"oneOf.5.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after a feedback is sent to a source as a consequence of the recipient providing feedback","enum":["feedback-sent"],"isRequired":true,"uniqueKey":"oneOf.5.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Feedback Event Variables","description":"All variables from the most recent event for the lead receiving feedback. Additionally contains\nfeedback metadata at `feedback.`.\n","additionalProperties":false,"uniqueKey":"oneOf.5.vars","typeLabel":"Feedback Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.5.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.5.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.5.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.5.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.5.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.5.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.5.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.5.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.5.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.5.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.5.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.5.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.5.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.5.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.5.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.5.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting for all recipients to respond","uniqueKey":"oneOf.5.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.5.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.5.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted","uniqueKey":"oneOf.5.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.5.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.5.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.5.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.5.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.5.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.5.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.5.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.5.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.5.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.5.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.5.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.5.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.5.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.5.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.5.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.5.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.5.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.5.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.5.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.5.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.5.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.metadata","typeLabel":"Metadata · object | null"},"module_id":{"title":"Integration Module ID","type":"string","description":"The integration module ID configured for the recipient","example":"leadconduit-salesforce.outbound.create_contact","uniqueKey":"oneOf.5.module_id","typeLabel":"string"},"recipient_event_id":{"type":"string","description":"The ID of the recipient event used to provide the feedback","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.5.recipient_event_id","typeLabel":"string"},"step_id":{"type":"string","description":"The ID flow step that originally sent the lead to the recipient","uniqueKey":"oneOf.5.step_id","typeLabel":"string"},"feedback":{"description":"Feedback specifies the configuration for receiving and sending feedback\nabout a lead. When receiving feedback from a recipient, the `rule_set`\nmust pass. If it does not, a \"failure\" Feedback Received Event is\ncreated. When sending feedback to a source, the `rule_set` must pass. If\nit does not, a \" skip\" Feedback Sent Event is created.\n","properties":{"integration":{"type":"object","properties":{"module_id":{"title":"Integration Module ID","type":"string","description":"A pointer to the integration code to use for this integration\n","example":"leadconduit-salesforce.outbound.create_contact","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.module_id","typeLabel":"string"},"mappings":{"oneOf":[{"type":"array","items":{"description":"Mappings transform data between systems using rule-based translations. They handle field renaming, data restructuring, and conditional transformations for both inbound (sources) and outbound (recipients) data.\n\n## Core Structure\n\nEach mapping has three components:\n1. **Property**: Destination field name\n2. **Value**: Template-based value assignment\n3. **Rule Set**: Optional conditions for application\n\n```json\n{\n \"property\": \"full_name\",\n \"value\": \"{{lead.first_name}} {{lead.last_name}}\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [{\"lhv\": \"lead.state\", \"op\": \"is equal to\", \"rhv\": \"TX\"}]\n }\n}\n```\n\n## Inbound vs Outbound Mapping\n\n### Inbound Mapping (Source → LeadConduit)\n**Purpose**: Standardize field names during lead submission\n**Context**: Raw submission data before the lead object exists\n**Use Case**: Only needed when source field names don't match LeadConduit standards\n\n**Technical Detail**: Inbound mappings execute in the handler before the lead object is created. Templates can only reference raw submission fields (not `lead.field` syntax). The `lead.` prefix in properties tells the system to assign values to the lead object that will be created after mapping.\n\n```json\n// Source sends non-standard names\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_addr}}\"}\n]\n```\n\n**Key Rules**:\n- Use exact source field names in value templates (no `lead.` prefix)\n- Use LeadConduit field IDs in property templates (with `lead.` prefix)\n- Don't transform data - let type system handle normalization\n- Field renaming only\n\n### Outbound Mapping (LeadConduit → Recipient)\n**Purpose**: Transform processed data for recipient requirements\n**Context**: Complete lead data with all type components, all appended data\n**Use Case**: Format data, combine fields, extract components\n\n```json\n[\n {\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"},\n {\"property\": \"FormattedPhone\", \"value\": \"({{lead.phone_1.area}}) {{lead.phone_1.exchange}}-{{lead.phone_1.line}}\"},\n {\"property\": \"EmailDomain\", \"value\": \"{{lead.email.domain}}\"}\n]\n```\n\n**Key Rules**:\n- Use LeadConduit field IDs in templates\n- Leverage field value's components provided by the field's type\n- Transform data for recipient needs\n- Use conditional logic for business rules\n\n## Property Path Syntax\n\n**Simple**: `\"email\"`\n**Nested**: `\"contact.primary.email\"` → `{contact: {primary: {email: \"value\"}}}`\n**Arrays**: `\"phones.0\"` → `{phones: [\"value\"]}`\n**Special Keys**: `\"data{2024}.revenue\"` → `{data: {\"2024\": {revenue: \"value\"}}}`\n\n## Template Features\n\n**Field Access**: `{{lead.email}}`\n**Components**: `{{lead.phone_1.area}}`\n**Formatting**: `{{format lead.dob format=\"MM/DD/YYYY\"}}`\n**Calculations**: `{{math lead.loan_amount * 1.05}}`\n**Combinations**: `{{lead.first_name}} {{lead.last_name}}`\n\n## Common Patterns\n\n**Basic Field Renaming (Inbound)**:\n```json\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_address}}\"}\n]\n```\n\n**Field Combining (Outbound)**:\n```json\n{\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"}\n```\n\n**Conditional Fields**:\n```json\n{\n \"property\": \"premium_lead\",\n \"value\": \"true\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [\n {\"lhv\": \"lead.annual_income\", \"op\": \"is greater than\", \"rhv\": \"100000\"}\n ]\n }\n}\n```\n\n**Static Field Value**:\n```json\n{\n \"property\": \"aff_id\",\n \"value\": \"aff-103331\",\n}\n```\n\n**Nested Structures**:\n```json\n[\n {\"property\": \"applicant.name.first\", \"value\": \"{{lead.first_name}}\"},\n {\"property\": \"applicant.contact.email\", \"value\": \"{{lead.email}}\"}\n]\n```\n\n**Conditional Field Value Based on Precedence**:\n```json\n[\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_2}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_2.valid\", \"op\": \"is true\"}]}\n },\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_1}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_1.valid\", \"op\": \"is true\"}]}\n }\n]\n```\n\n## Special Behaviors\n\n**Processing Order**: Mappings apply sequentially, allowing overwrites\n**Empty Values**: Template results that are empty are skipped; explicit empty strings are applied\n**Type Preservation**: Simple variable templates preserve data types; string concatenation converts to string\n**Error Recovery**: Individual mapping failures don't stop processing\n\n## Best Practices\n\n**Inbound**: Only map fields with different names; let type system handle normalization; use simple templates\n**Outbound**: Use type components instead of string parsing; make property names self-documenting; test edge cases\n**Performance**: Order rules efficiently; minimize complex templates; group related mappings\n\n## Common Pitfalls\n\n### Pitfall: Transforming on Inbound\n❌ **Wrong**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{lowercase email_address}}\" // Don't do this!\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{email_address}}\" // Type system handles lowercasing\n}\n```\n\n### Pitfall: Using Wrong Field Names\n❌ **Wrong**:\n```json\n// In outbound mapping:\n{\n \"value\": \"{{lead.phone_1.area}}\" // Backend syntax\n}\n```\n✅ **Right**:\n```json\n{\n \"value\": \"{{Phone 1 > Area}}\" // UI display name with component\n}\n```\n\n### Pitfall: Over-Mapping\n❌ **Wrong**: Mapping fields that already match\n```json\n// If source sends \"email\", don't do this:\n{ \"property\": \"lead.email\", \"value\": \"{{email}}\" } // Unnecessary!\n```\n✅ **Right**: Only map when names differ\n\n### Pitfall: String Manipulation Instead of Components\n❌ **Wrong**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{substring Phone 1 start=1 end=4}}\"\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{Phone 1 > Area}}\"\n}\n```\n\n## Integration\n\n**With Types**: Inbound mappings happen before type conversion, outbound after\n**With Rules**: Control when mappings apply based on business logic\n**With Templates**: Provide dynamic values from lead data and components","type":"object","properties":{"property":{"description":"The name of the variable to set","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].property","typeLabel":"string"},"value":{"oneOf":[{"type":"string","title":"Template","description":"The value to set","x-tags":["Templates"],"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.1","typeLabel":"number"},{"type":"null","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.2","typeLabel":"null"},{"type":"array","items":{"oneOf":[{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3.items.[INDEX]","typeLabel":"string | null"},"description":"The value to set","minItems":1,"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value.oneOf.3","typeLabel":"(string | null)[]"}],"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].value","typeLabel":"string | number | null | (string | null)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this mapping","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].id","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"Only apply the mapping if this rule set passes","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["property","value"],"uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The mappings to apply to lead data when interacting with this\nintegration\n","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"The mappings to apply to lead data when interacting with this\nintegration\n","uniqueKey":"oneOf.5.feedback.integration.mappings.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.integration.mappings","typeLabel":"object[] | null"}},"additionalProperties":false,"required":["module_id"],"description":"The integration to be used for the feedback","isRequired":true,"uniqueKey":"oneOf.5.feedback.integration","typeLabel":"object"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"If the rules fail the feedback is not performed","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.5.feedback.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.5.feedback.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.5.feedback.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.5.feedback.rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["integration"],"type":"object","uniqueKey":"oneOf.5.feedback","typeLabel":"object"},"request":{"type":"object","properties":{"method":{"type":"string","description":"HTTP request method","enum":["GET","POST","PUT","DELETE","PATCH","OPTIONS"],"example":"POST","isRequired":true,"uniqueKey":"oneOf.5.request.method","typeLabel":"enum\u003cstring>"},"uri":{"type":"string","description":"The full URI","format":"uri","example":"https://app.leadconduit.com/flows/5fd4371e940df5a34a3888b2/sources/6369a0e534c9d4ebe142e0ef/submit","isRequired":true,"uniqueKey":"oneOf.5.request.uri","typeLabel":"string\u003curi>"},"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.5.request.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent on the request","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.5.request.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the request body","example":"{\"email\":\"johndoe@email.com\",\"phone_1\":\"5127891111\"}","isRequired":true,"uniqueKey":"oneOf.5.request.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately prior to sending the request","isRequired":true,"uniqueKey":"oneOf.5.request.timestamp","typeLabel":"integer"}},"required":["method","uri","version","headers","body","timestamp"],"additionalProperties":false,"description":"The feedback HTTP request","uniqueKey":"oneOf.5.request","typeLabel":"object"},"response":{"type":"object","properties":{"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.5.response.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent in the response","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.5.response.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the response body","example":"{\"outcome\":\"success\",\"lead\":{\"id\":\"63cc6f0e55254d7d1c4c3037\"}}","isRequired":true,"uniqueKey":"oneOf.5.response.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately after reading the response body","isRequired":true,"uniqueKey":"oneOf.5.response.timestamp","typeLabel":"integer"},"status":{"type":"integer","description":"HTTP status code","example":201,"uniqueKey":"oneOf.5.response.status","typeLabel":"integer"},"status_text":{"type":"string","description":"The textual representation of the status","format":"uri","example":"Created","uniqueKey":"oneOf.5.response.status_text","typeLabel":"string\u003curi>"}},"required":["method","uri","version","headers","body","timestamp"],"description":"The feedback HTTP response","uniqueKey":"oneOf.5.response","typeLabel":"object"}},"uniqueKey":"oneOf.5","typeLabel":"Feedback Sent Event · object"},{"type":"object","title":"Retry Event","description":"When a recipient step results in an error outcome and retry is enabled, a retry event is recorded\n","required":["id","type","outcome","reason"],"x-tags":["Leads"],"properties":{"id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.id","typeLabel":"string"},"outcome":{"type":"string","description":"The outcome of the event","enum":["success","failure","error","skip"],"x-enumDescriptions":{"success":"The recipient accepted the lead","failure":"The recipient rejected the lead","error":"An error occurred while attempting to communicate with the recipient","skip":"The recipient step was skipped due to failure the rule set or cap having been met"},"isRequired":true,"uniqueKey":"oneOf.6.outcome","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","description":"The reason for a failure or error outcome","isRequired":true,"uniqueKey":"oneOf.6.reason","typeLabel":"string"},"type":{"type":"string","description":"Recorded after an error recipient event is retried","enum":["retry"],"isRequired":true,"uniqueKey":"oneOf.6.type","typeLabel":"enum\u003cstring>"},"vars":{"type":"object","title":"Recipient Event Variables","description":"All data available at the time LeadConduit starts processing the recipient step. The following\nadditional data will be added to the vars for the purposes of processing this step.\n* `price` — The price to be paid to the recipient\n* `purchase_price` - The cost of the lead paid to the source\n* `event_id` - The identifier of this event (so it can be sent to the recipient for feedback)\n* `recipient` — The `id` and `name` of the recipient\n","properties":{"price":{"type":"number","description":"The price to be paid to the recipient","uniqueKey":"oneOf.6.vars.price","typeLabel":"number"},"purchase_price":{"type":"number","description":"The cost of the lead paid to the source","uniqueKey":"oneOf.6.vars.purchase_price","typeLabel":"number"},"event_id":{"type":"string","description":"The unique identifier for an a lead event","pattern":"^[0-9a-fA-F]{24}$","example":"636999a5a28de89048cd16fc","uniqueKey":"oneOf.6.vars.event_id","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"oneOf.6.vars","typeLabel":"Recipient Event Variables · object"},"host":{"type":"string","uniqueKey":"oneOf.6.host","typeLabel":"string"},"start_timestamp":{"description":"The number of milliseconds elapsed since epoch at the start of the step processing","type":"integer","uniqueKey":"oneOf.6.start_timestamp","typeLabel":"integer"},"end_timestamp":{"description":"The number of milliseconds elapsed since epoch at the end of the step processing","type":"integer","uniqueKey":"oneOf.6.end_timestamp","typeLabel":"integer"},"firehose":{"type":"object","description":"Firehose configuration for exporting event data to cloud storage. Supports a legacy flat format (AWS S3 only) and a service-based format that allows multiple cloud storage providers.\n","properties":{"enabled":{"type":"boolean","description":"Is the firehose enabled for this flow?","isRequired":true,"uniqueKey":"oneOf.6.firehose.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys (legacy format)","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.6.firehose.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket (legacy format)","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","uniqueKey":"oneOf.6.firehose.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json (legacy format)","uniqueKey":"oneOf.6.firehose.prefix","typeLabel":"string"},"services":{"type":"object","description":"Service-based configuration allowing multiple cloud storage providers","properties":{"aws":{"type":"object","description":"AWS S3 firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the AWS S3 firehose enabled?","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.aws.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the AWS keys","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.aws.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the S3 bucket","pattern":"^(?=^.{3,63}$)(?!^(\\d+\\.?)+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9]))$","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.aws.bucket","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to S3 will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.6.firehose.services.aws.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.6.firehose.services.aws","typeLabel":"object"},"azure":{"type":"object","description":"Azure Blob Storage firehose service configuration","properties":{"enabled":{"type":"boolean","description":"Is the Azure Blob Storage firehose enabled?","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.azure.enabled","typeLabel":"boolean"},"credential_id":{"type":"string","description":"The ID of the credential storing the Azure connection string","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.azure.credential_id","typeLabel":"string"},"bucket":{"type":"string","description":"The name of the Azure Blob Storage container","isRequired":true,"uniqueKey":"oneOf.6.firehose.services.azure.bucket","typeLabel":"string"},"connection_string":{"type":"string","description":"The Azure Blob Storage connection string","uniqueKey":"oneOf.6.firehose.services.azure.connection_string","typeLabel":"string"},"prefix":{"type":"string","description":"Optional. If provided, files written to Azure will be written as \u0026lt;prefix>/\u0026lt;lead id>/\u0026lt;event id>.json","uniqueKey":"oneOf.6.firehose.services.azure.prefix","typeLabel":"string"}},"required":["credential_id","bucket","enabled"],"additionalProperties":false,"uniqueKey":"oneOf.6.firehose.services.azure","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"oneOf.6.firehose.services","typeLabel":"object"}},"required":["enabled"],"uniqueKey":"oneOf.6.firehose","typeLabel":"object"},"ms":{"description":"The number of milliseconds that elapsed while processing the lead","type":"integer","uniqueKey":"oneOf.6.ms","typeLabel":"integer"},"wait_ms":{"type":"integer","description":"The number of milliseconds that LeadConduit spent waiting the recipient to respond","uniqueKey":"oneOf.6.wait_ms","typeLabel":"integer"},"overhead_ms":{"description":"The number of milliseconds of overhead that LeadConduit added while processing the step","type":"integer","uniqueKey":"oneOf.6.overhead_ms","typeLabel":"integer"},"lag_ms":{"type":"integer","uniqueKey":"oneOf.6.lag_ms","typeLabel":"integer"},"total_ms":{"type":"integer","description":"The number of milliseconds that elapsed since the lead was submitted ","uniqueKey":"oneOf.6.total_ms","typeLabel":"integer"},"handler_version":{"type":"string","description":"The version of the lead handler","uniqueKey":"oneOf.6.handler_version","typeLabel":"string"},"version":{"type":"string","description":"The schema version of the event","uniqueKey":"oneOf.6.version","typeLabel":"string"},"cap_reached":{"type":"boolean","uniqueKey":"oneOf.6.cap_reached","typeLabel":"boolean"},"flow_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.6.flow_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.6.flow_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.6.flow_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.6.flow_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.6.flow_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.6.flow_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.6.flow_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.6.flow_ping_limits","typeLabel":"Ping Limit · object"},"source_ping_limits":{"x-tags":["Caps and Limits"],"title":"Ping Limit","description":"The ping limit configuration is defined in a flow on a source, or directly on the flow itself. The configuration controls the behavior of the ping limit by setting the maximum and the duration. The counter for a ping limit is kept as a standalone record which shares ping limit's ID.","type":"object","properties":{"id":{"type":"string","description":"24 character alpha-numeric BSON identifier","pattern":"^[0-9a-fA-F]{24}$","readOnly":true,"example":"5fd4371e940df5a34a3888b2","uniqueKey":"oneOf.6.source_ping_limits.id","typeLabel":"string"},"name":{"type":"string","description":"The human-readable name of the ping limit","uniqueKey":"oneOf.6.source_ping_limits.name","typeLabel":"string"},"maximum":{"type":"integer","description":"The number of pings that will be accepted","uniqueKey":"oneOf.6.source_ping_limits.maximum","typeLabel":"integer"},"duration":{"type":"integer","description":"The number duration_units the ping limit persists for","uniqueKey":"oneOf.6.source_ping_limits.duration","typeLabel":"integer"},"duration_units":{"type":"string","description":"The unit of time the ping limit persists for: minute, hour, day, week, or month","uniqueKey":"oneOf.6.source_ping_limits.duration_units","typeLabel":"string"},"time_zone":{"type":"string","description":"The time zone in which ping limit resets","example":"America/New_York","uniqueKey":"oneOf.6.source_ping_limits.time_zone","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","description":"Read-only time the ping limit was created","readOnly":true,"uniqueKey":"oneOf.6.source_ping_limits.created_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"oneOf.6.source_ping_limits","typeLabel":"Ping Limit · object"},"ping_limit_reached":{"type":"boolean","uniqueKey":"oneOf.6.ping_limit_reached","typeLabel":"boolean"},"expires_at":{"type":"string","format":"date-time","description":"The time this event will be automatically deleted from LeadConduit (events are retained for 90 days)","uniqueKey":"oneOf.6.expires_at","typeLabel":"string\u003cdate-time>"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"The metadata of the step that created the event, as set on the flow","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.metadata","typeLabel":"Metadata · object | null"},"retry_status":{"type":"string","enum":["started","completed"],"uniqueKey":"oneOf.6.retry_status","typeLabel":"enum\u003cstring>"},"step_id":{"type":"string","description":"The id of the step in the flow associated with this event","uniqueKey":"oneOf.6.step_id","typeLabel":"string"},"caps_reached":{"type":"boolean","description":"One or more of the recipient caps were met","uniqueKey":"oneOf.6.caps_reached","typeLabel":"boolean"},"key":{"type":"string","description":"The property name on the event where appended data is stored","uniqueKey":"oneOf.6.key","typeLabel":"string"},"cost":{"type":"number","format":"double","description":"The amount paid for the purchase of this lead","uniqueKey":"oneOf.6.cost","typeLabel":"number\u003cdouble>"},"purchase_price":{"type":"number","format":"double","description":"The amount paid for the purchase of this lead","uniqueKey":"oneOf.6.purchase_price","typeLabel":"number\u003cdouble>"},"sale_price":{"type":"number","format":"double","description":"The revenue received for the sale of this lead","uniqueKey":"oneOf.6.sale_price","typeLabel":"number\u003cdouble>"},"revenue":{"type":"number","format":"double","description":"The difference between the purchase price and the sale price","uniqueKey":"oneOf.6.revenue","typeLabel":"number\u003cdouble>"},"module_id":{"title":"Integration Module ID","type":"string","description":"The unique identifier of the integration module","example":"leadconduit-salesforce.outbound.create_contact","uniqueKey":"oneOf.6.module_id","typeLabel":"string"},"credential":{"oneOf":[{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","username","password"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["user"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.type","typeLabel":"enum\u003cstring>"},"username":{"description":"The username to use for basic authentication","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.username","typeLabel":"string"},"password":{"description":"The password to use for basic authentication","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.0.password","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.0.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.0.updated_at","typeLabel":"string\u003cdate-time>"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.0","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.1.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.1.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.1.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["token"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.1.type","typeLabel":"enum\u003cstring>"},"token":{"description":"The access token to use with type token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.1.token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.1.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.1.updated_at","typeLabel":"string\u003cdate-time>"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.1","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","consumer_key","consumer_secret","token_key","access_token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["oauth1"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.type","typeLabel":"enum\u003cstring>"},"consumer_key":{"description":"The OAuth 1.0 consumer key","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.consumer_key","typeLabel":"string"},"consumer_secret":{"description":"The OAuth 1.0 consumer secret","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.consumer_secret","typeLabel":"string"},"token_key":{"description":"The OAuth 1.0 token key","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.token_key","typeLabel":"string"},"access_token":{"description":"The OAuth 1.0 access token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.2.access_token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.2.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.2.updated_at","typeLabel":"string\u003cdate-time>"},"realm":{"description":"The OAuth 1.0 realm","type":"string","uniqueKey":"oneOf.6.credential.oneOf.2.realm","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.2","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","access_token"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.3.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.3.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.3.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["oauth2"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.3.type","typeLabel":"enum\u003cstring>"},"access_token":{"description":"The OAuth 2.0 access token","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.3.access_token","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.3.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.3.updated_at","typeLabel":"string\u003cdate-time>"},"refresh_token":{"description":"The OAuth 2.0 refresh token used to obtain a new access token","type":"string","minLength":1,"uniqueKey":"oneOf.6.credential.oneOf.3.refresh_token","typeLabel":"string"},"expires_at":{"description":"The time in epoch milliseconds at which the access token will expire","type":"integer","format":"int64","uniqueKey":"oneOf.6.credential.oneOf.3.expires_at","typeLabel":"integer\u003cint64>"},"environment":{"description":"The environment for the OAuth connection (e.g. production, sandbox)","type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.environment","typeLabel":"string"},"user":{"description":"The user the credential belongs to","type":"object","properties":{"id":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.id","typeLabel":"string"},"username":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.username","typeLabel":"string"},"first_name":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.first_name","typeLabel":"string"},"last_name":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.last_name","typeLabel":"string"},"email":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.email","typeLabel":"string"},"phone":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.user.phone","typeLabel":"string"}},"uniqueKey":"oneOf.6.credential.oneOf.3.user","typeLabel":"object"},"org":{"description":"The organization the credential belongs to","type":"object","properties":{"id":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.org.id","typeLabel":"string"},"type":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.org.type","typeLabel":"string"},"name":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.org.name","typeLabel":"string"},"prefix":{"type":"string","uniqueKey":"oneOf.6.credential.oneOf.3.org.prefix","typeLabel":"string"}},"uniqueKey":"oneOf.6.credential.oneOf.3.org","typeLabel":"object"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.3","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.4.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.4.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.4.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["integration_platform_credential"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.4.type","typeLabel":"enum\u003cstring>"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.4.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.4.updated_at","typeLabel":"string\u003cdate-time>"},"instance_id":{"description":"The Integration Platform app instance this credential belongs to","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.instance_id","typeLabel":"string"},"connection_instance_id":{"description":"The Integration Platform connection instance this credential belongs to","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.connection_instance_id","typeLabel":"string"},"marketplace_app_id":{"description":"The marketplace app this credential was created for","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.marketplace_app_id","typeLabel":"string"},"callback_url":{"description":"The LeadConduit URL the app posts leads to","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.callback_url","typeLabel":"string"},"signing_secret":{"description":"The HMAC key used to verify inbound webhooks. Returned once by create and update, then omitted from list, show, and delete responses.","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.signing_secret","typeLabel":"string"},"flow_id":{"description":"The flow this credential was bound to at flow-save time","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.flow_id","typeLabel":"string"},"callback_id":{"description":"The callback this credential was bound to at flow-save time","type":"string","uniqueKey":"oneOf.6.credential.oneOf.4.callback_id","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.4","typeLabel":"object"},{"type":"object","description":"Used by integrations with external services that require authentication.\n\n**Masking:** Some credential types have secret fields stripped from list, show, and\ndelete responses, and from changelog entries read back through the API:\n\n| Type / package | Field omitted on read |\n|---|---|\n| type `integration_platform_credential` | `signing_secret` |\n| type `aws_sigv4` | `secret_access_key` |\n| package `leadconduit-infutordata` | `token` |\n\nAll other fields (name, type, package, instance_id, access_key_id, region, etc.)\nremain visible. For the two types above, create responses return the full\ncredential once, and update responses return the secret once only when the\nrequest supplied a new value; a blank or omitted secret on update keeps the\nstored value. `leadconduit-infutordata` credentials always mask update responses\nand may return some identifier fields partially masked. Other `user`, `token`,\nand OAuth credentials are not masked on read.\n","required":["id","name","package","type","access_key_id","secret_access_key"],"x-tags":["Account"],"properties":{"id":{"type":"string","description":"The unique identifier for a credential","pattern":"^[0-9a-fA-F]{24}$","example":"5fd4371e940df5a34a3888b2","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.id","typeLabel":"string"},"name":{"type":"string","description":"Friendly name for this credential","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.name","typeLabel":"string"},"package":{"type":"string","description":"The name of the LeadConduit integration package to which this credential belongs","isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.package","typeLabel":"string"},"type":{"type":"string","description":"The credential type","enum":["aws_sigv4"],"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.type","typeLabel":"enum\u003cstring>"},"access_key_id":{"description":"The AWS access key ID used to sign requests","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.access_key_id","typeLabel":"string"},"secret_access_key":{"description":"The AWS secret access key used to sign requests. Returned once by create and update, then omitted from list, show, and delete responses.","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.credential.oneOf.5.secret_access_key","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.5.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"uniqueKey":"oneOf.6.credential.oneOf.5.updated_at","typeLabel":"string\u003cdate-time>"},"region":{"description":"The AWS region the signature is scoped to, for example `us-west-2`. Optional: when\nabsent, the region is derived from the endpoint hostname, which is correct for an\n`execute-api.\u003cregion>.amazonaws.com` URL. Set it for a custom domain, where nothing\ncan be derived and signing falls back to `us-east-1` — which produces an opaque 403\nrather than an error. An explicit region overrides the hostname, so a value that\ndisagrees with the URL will break signing.\n","type":"string","minLength":1,"uniqueKey":"oneOf.6.credential.oneOf.5.region","typeLabel":"string"},"service":{"description":"The AWS service the signature is scoped to, for example `execute-api` for API\nGateway or `s3` for S3. Optional: when absent, the service is derived from the\nendpoint hostname, and a custom domain falls back to `execute-api`, because a\nhostname that encodes no service yields an empty scope segment that AWS rejects.\n","type":"string","minLength":1,"uniqueKey":"oneOf.6.credential.oneOf.5.service","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.6.credential.oneOf.5","typeLabel":"object"}],"uniqueKey":"oneOf.6.credential","typeLabel":"object"},"credential_updated":{"type":"boolean","description":"Whether the credential used by the integration was refreshed","uniqueKey":"oneOf.6.credential_updated","typeLabel":"boolean"},"package_version":{"type":"string","description":"A \u003ca href=\"http://semver.org\" target=\"_blank\">semantic version\u003c/a>","uniqueKey":"oneOf.6.package_version","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"The rule set configured on the recipient step when the lead was processed ","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.6.rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.6.rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.6.rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.6.rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.6.rule_set","typeLabel":"Rule Set · object"},"mappings":{"type":"array","description":"The mappings applied while invoking the integration","items":{"description":"Mappings transform data between systems using rule-based translations. They handle field renaming, data restructuring, and conditional transformations for both inbound (sources) and outbound (recipients) data.\n\n## Core Structure\n\nEach mapping has three components:\n1. **Property**: Destination field name\n2. **Value**: Template-based value assignment\n3. **Rule Set**: Optional conditions for application\n\n```json\n{\n \"property\": \"full_name\",\n \"value\": \"{{lead.first_name}} {{lead.last_name}}\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [{\"lhv\": \"lead.state\", \"op\": \"is equal to\", \"rhv\": \"TX\"}]\n }\n}\n```\n\n## Inbound vs Outbound Mapping\n\n### Inbound Mapping (Source → LeadConduit)\n**Purpose**: Standardize field names during lead submission\n**Context**: Raw submission data before the lead object exists\n**Use Case**: Only needed when source field names don't match LeadConduit standards\n\n**Technical Detail**: Inbound mappings execute in the handler before the lead object is created. Templates can only reference raw submission fields (not `lead.field` syntax). The `lead.` prefix in properties tells the system to assign values to the lead object that will be created after mapping.\n\n```json\n// Source sends non-standard names\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_addr}}\"}\n]\n```\n\n**Key Rules**:\n- Use exact source field names in value templates (no `lead.` prefix)\n- Use LeadConduit field IDs in property templates (with `lead.` prefix)\n- Don't transform data - let type system handle normalization\n- Field renaming only\n\n### Outbound Mapping (LeadConduit → Recipient)\n**Purpose**: Transform processed data for recipient requirements\n**Context**: Complete lead data with all type components, all appended data\n**Use Case**: Format data, combine fields, extract components\n\n```json\n[\n {\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"},\n {\"property\": \"FormattedPhone\", \"value\": \"({{lead.phone_1.area}}) {{lead.phone_1.exchange}}-{{lead.phone_1.line}}\"},\n {\"property\": \"EmailDomain\", \"value\": \"{{lead.email.domain}}\"}\n]\n```\n\n**Key Rules**:\n- Use LeadConduit field IDs in templates\n- Leverage field value's components provided by the field's type\n- Transform data for recipient needs\n- Use conditional logic for business rules\n\n## Property Path Syntax\n\n**Simple**: `\"email\"`\n**Nested**: `\"contact.primary.email\"` → `{contact: {primary: {email: \"value\"}}}`\n**Arrays**: `\"phones.0\"` → `{phones: [\"value\"]}`\n**Special Keys**: `\"data{2024}.revenue\"` → `{data: {\"2024\": {revenue: \"value\"}}}`\n\n## Template Features\n\n**Field Access**: `{{lead.email}}`\n**Components**: `{{lead.phone_1.area}}`\n**Formatting**: `{{format lead.dob format=\"MM/DD/YYYY\"}}`\n**Calculations**: `{{math lead.loan_amount * 1.05}}`\n**Combinations**: `{{lead.first_name}} {{lead.last_name}}`\n\n## Common Patterns\n\n**Basic Field Renaming (Inbound)**:\n```json\n[\n {\"property\": \"lead.first_name\", \"value\": \"{{fname}}\"},\n {\"property\": \"lead.email\", \"value\": \"{{email_address}}\"}\n]\n```\n\n**Field Combining (Outbound)**:\n```json\n{\"property\": \"FullName\", \"value\": \"{{lead.first_name}} {{lead.last_name}}\"}\n```\n\n**Conditional Fields**:\n```json\n{\n \"property\": \"premium_lead\",\n \"value\": \"true\",\n \"rule_set\": {\n \"op\": \"and\",\n \"rules\": [\n {\"lhv\": \"lead.annual_income\", \"op\": \"is greater than\", \"rhv\": \"100000\"}\n ]\n }\n}\n```\n\n**Static Field Value**:\n```json\n{\n \"property\": \"aff_id\",\n \"value\": \"aff-103331\",\n}\n```\n\n**Nested Structures**:\n```json\n[\n {\"property\": \"applicant.name.first\", \"value\": \"{{lead.first_name}}\"},\n {\"property\": \"applicant.contact.email\", \"value\": \"{{lead.email}}\"}\n]\n```\n\n**Conditional Field Value Based on Precedence**:\n```json\n[\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_2}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_2.valid\", \"op\": \"is true\"}]}\n },\n {\n \"property\": \"best_phone\",\n \"value\": \"{{lead.phone_1}}\",\n \"rule_set\": {\"rules\": [{\"lhv\": \"lead.phone_1.valid\", \"op\": \"is true\"}]}\n }\n]\n```\n\n## Special Behaviors\n\n**Processing Order**: Mappings apply sequentially, allowing overwrites\n**Empty Values**: Template results that are empty are skipped; explicit empty strings are applied\n**Type Preservation**: Simple variable templates preserve data types; string concatenation converts to string\n**Error Recovery**: Individual mapping failures don't stop processing\n\n## Best Practices\n\n**Inbound**: Only map fields with different names; let type system handle normalization; use simple templates\n**Outbound**: Use type components instead of string parsing; make property names self-documenting; test edge cases\n**Performance**: Order rules efficiently; minimize complex templates; group related mappings\n\n## Common Pitfalls\n\n### Pitfall: Transforming on Inbound\n❌ **Wrong**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{lowercase email_address}}\" // Don't do this!\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"lead.email\",\n \"value\": \"{{email_address}}\" // Type system handles lowercasing\n}\n```\n\n### Pitfall: Using Wrong Field Names\n❌ **Wrong**:\n```json\n// In outbound mapping:\n{\n \"value\": \"{{lead.phone_1.area}}\" // Backend syntax\n}\n```\n✅ **Right**:\n```json\n{\n \"value\": \"{{Phone 1 > Area}}\" // UI display name with component\n}\n```\n\n### Pitfall: Over-Mapping\n❌ **Wrong**: Mapping fields that already match\n```json\n// If source sends \"email\", don't do this:\n{ \"property\": \"lead.email\", \"value\": \"{{email}}\" } // Unnecessary!\n```\n✅ **Right**: Only map when names differ\n\n### Pitfall: String Manipulation Instead of Components\n❌ **Wrong**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{substring Phone 1 start=1 end=4}}\"\n}\n```\n✅ **Right**:\n```json\n{\n \"property\": \"area_code\",\n \"value\": \"{{Phone 1 > Area}}\"\n}\n```\n\n## Integration\n\n**With Types**: Inbound mappings happen before type conversion, outbound after\n**With Rules**: Control when mappings apply based on business logic\n**With Templates**: Provide dynamic values from lead data and components","type":"object","properties":{"property":{"description":"The name of the variable to set","type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].property","typeLabel":"string"},"value":{"oneOf":[{"type":"string","title":"Template","description":"The value to set","x-tags":["Templates"],"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.1","typeLabel":"number"},{"type":"null","description":"The value to set","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.2","typeLabel":"null"},{"type":"array","items":{"oneOf":[{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.3.items.[INDEX]","typeLabel":"string | null"},"description":"The value to set","minItems":1,"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].value.oneOf.3","typeLabel":"(string | null)[]"}],"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].value","typeLabel":"string | number | null | (string | null)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this mapping","uniqueKey":"oneOf.6.mappings.items.[INDEX].id","typeLabel":"string"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"Only apply the mapping if this rule set passes","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.6.mappings.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"additionalProperties":false,"required":["property","value"],"uniqueKey":"oneOf.6.mappings.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.6.mappings","typeLabel":"object[]"},"pricing":{"description":"The pricing configuration applied to this recipient","type":"object","properties":{"override":{"description":"Allows a source or a recipient to specify the price rather than\nrelying on `prices`\n","type":"boolean","uniqueKey":"oneOf.6.pricing.override","typeLabel":"boolean"},"prices":{"description":"The list of prices to evaluate for each lead","type":"array","items":{"description":"A price determines the `purchase_price` or `sale_price` for a lead. If\nall rules in the `rule_set` pass, then the appropriate price property\nwill be set equal to the `amount`. When more than one price is\nspecified, the last matching price will be used to set the price\nproperty on the event.\n","type":"object","properties":{"amount":{"description":"The price of the lead in USD","type":"number","exclusiveMinimum":0,"isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].amount","typeLabel":"number"},"id":{"$circularRef":"5d3151ea-7285-4faa-9e58-f06d41c57a09","description":"ID of this price (matches the ID of the corresponding price configuration)\n","uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].id","typeLabel":"any"},"rule_set":{"x-tags":["Rules"],"title":"Rule Set","type":"object","description":"The rule set which must pass in order for this price to be\nconsidered\n","properties":{"op":{"type":"string","description":"Determines whether all rules or just some rules must pass for the overall set to pass","enum":["and","or"],"x-enumDescriptions":{"and":"All rules in the set must pass","or":"Only one rule in the set must pass"},"isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.op","typeLabel":"enum\u003cstring>"},"rules":{"type":"array","description":"The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Binary Rule","required":["lhv","op","rhv"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The required left-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.state","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is equal to","is not equal to","is less than","is less than or equal to","is greater than","is greater than or equal to","is included in","is not included in","includes","does not include","is between","is not between","matches pattern","does not match pattern"],"example":"is equal to","x-enumDescriptions":{"is equal to":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type) (case-insensitive), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` equal to the `rhv`?","is not equal to":"Inverse of the `is equal to` operator.","is less than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than the `rhv`?","is less than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically less than or equal to the `rhv`?","is greater than":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than the `rhv`?","is greater than or equal to":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` numerically more than or equal to the `rhv`?","is between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` between the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (inclusive)?","is not between":"Is the [numeric](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type) or [range average](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `lhv` outside the `rhv` [range](https://developers.activeprospect.com/api-reference/leadconduit/types#range-type) `min` and `max` (exclusive)?","is included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` included in the Array of values provided in the `rhv`?","is not included in":"Is the [string](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [number](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [boolean](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) `lhv` missing from the Array of values provided in the `rhv`?","includes":"Does the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` contain the `rhv`?","does not include":"Is the Array of [strings](https://developers.activeprospect.com/api-reference/leadconduit/types#string-type), [numbers](https://developers.activeprospect.com/api-reference/leadconduit/types#number-type), or [booleans](https://developers.activeprospect.com/api-reference/leadconduit/types#boolean-type) provided in the `lhv` missing the `rhv`?"},"description":"Binary operators compare the `lhv` and the `rhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"rhv":{"oneOf":[{"type":"string","title":"Template","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"TX","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.0","typeLabel":"string"},{"type":"number","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","title":"Template","description":"# LeadConduit Templates\n\n## Overview\n\nTemplates are the dynamic value engine of LeadConduit. They transform static configurations into intelligent, adaptive systems by resolving variables, computing values, and manipulating data at runtime. Think of templates as smart placeholders that know how to fetch and transform data when needed.\n\nTemplates answer a fundamental question:\n**How do I get the right value at the right time?**\n\nTemplates work seamlessly with rules and mappings:\n- **Rules** use templates for dynamic comparisons\n- **Mappings** use templates to compute values\n- **Templates** provide the bridge between configuration and runtime data\n\n## Why Templates Exist\n\n### The Static Configuration Problem\nWithout templates, every value would be hard-coded:\n- Phone format: \"(512) 789-1111\" for everyone\n- Greeting: \"Hello Customer\" instead of personalized\n- Dates: Fixed instead of calculated\n- Prices: Static instead of computed\n\nTemplates make configurations come alive with actual data.\n\n### The Data Access Problem\nLead data has complex structures:\n- Nested objects: `address_1`, `city`\n- Array elements: `tags[0]`\n- Type components: `phone.area`\n- Calculated values: `price * tax_rate`\n\nTemplates provide a consistent way to access any data, anywhere.\n\n### The Transformation Problem\nRaw data rarely matches what you need:\n- Dates need formatting\n- Names need case changes\n- Numbers need calculations\n- Strings need manipulation\n\nTemplates include helpers that transform data on the fly.\n\n### Technical Details\n\nLeadConduit supports combining, [formatting](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-formatting),\n[hashing](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-hashing), and [performing math](https://developers.activeprospect.com/api-reference/leadconduit/templates#variable-math) on\nvalues using template markup. Templating in LeadConduit is based on the\npopular [Handlebars](https://handlebarsjs.com/) semantic templating\nlibrary. A template is a string which contains any number of variable\nplaceholders\n\n## Template Variable\n\nVariable placeholders in templates start and end with two curly-brace\ncharacters: `{{ lead.first_name }}`. Multiple placeholders can be\ncombined in a single template: `{{ lead.first_name }} {{ lead.last_name\n}}`. The [universe of possible variables](https://developers.activeprospect.com/api-reference/leadconduit/variables) available to a\ntemplate depends on the [fields](https://developers.activeprospect.com/api-reference/leadconduit/fields/field) defined in your flow and the\nsteps you've added to your flow.\n\n## Variable Formatting\n\nLeadConduit has a built-in helper for formatting numbers and dates.\nFormatting a value is done with the `format` helper. If the value is a\ndate field, then you may use date formatting options with the helper.\nIf it's a number field, then you may use the number formatting options\nwith the helper.\n\n### Date Variable Formatting\n\nTo format a date, use the `format` helper: `{{ format lead.dob\nformat=\"YYYY-MM-DD\" }}` results in '2015-06-24'. The `format` option is\na string which defines the format of the date. This format can be any\ncombination of the below tokens. To escape characters in format\nstrings, you can wrap the characters in square brackets: `{{ format\nlead.dob format=\"[It's] MMMM Do\" }}` results in \"It's October 12th\".\n\n#### Date Format Tokens\n\n| | Token | Output |\n| -------------------------- | -------------------------- | -----------|\n| Month | `M` | 1 2 ... 11 12\n| | `Mo` | 1st 2nd ... 11th 12th\n| | `MM` | 01 02 ... 11 12\n| | `MMM` | Jan Feb ... Nov Dec\n| | `MMMM` | January February ... November December\n| Quarter | `Q` | 1 2 3 4\n| | `Qo` | 1st 2nd 3rd 4th\n| Day of Month | `D` | 1 2 ... 30 31\n| | `Do` | 1st 2nd ... 30th 31st\n| | `DD` | 01 02 ... 30 31\n| Day of Year | `DDD` | 1 2 ... 364 365\n| | `DDDo` | 1st 2nd ... 364th 365th\n| | `DDDD` | 001 002 ... 364 365\n| Day of Week | `d` | 0 1 ... 5 6\n| | `do` | 0th 1st ... 5th 6th\n| | `dd` | Su Mo ... Fr Sa\n| | `ddd` | Sun Mon ... Fri Sat\n| | `dddd` | Sunday Monday ... Friday Saturday\n| Day of Week (Locale) | `e` | 0 1 ... 5 6\n| Day of Week (ISO) | `E` | 1 2 ... 6 7\n| Week of Year | `w` | 1 2 ... 52 53\n| | `wo` | 1st 2nd ... 52nd 53rd\n| | `ww` | 01 02 ... 52 53\n| Week of Year (ISO) | `W` | 1 2 ... 52 53\n| | `Wo` | 1st 2nd ... 52nd 53rd\n| | `WW` | 01 02 ... 52 53\n| Year | `YY` | 70 71 ... 29 30\n| | `YYYY` | 1970 1971 ... 2029 2030\n| | `Y` | 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999\n| Week Year | `gg` | 70 71 ... 29 30\n| | `gggg` | 1970 1971 ... 2029 2030\n| Week Year (ISO) | `GG` | 70 71 ... 29 30\n| | `GGGG` | 1970 1971 ... 2029 2030\n| AM/PM | `A` | AM PM\n| | `a` | am pm\n| Hour | `H` | 0 1 ... 22 23\n| | `HH` | 00 01 ... 22 23\n| | `h` | 1 2 ... 11 12\n| | `hh` | 01 02 ... 11 12\n| | `k` | 1 2 ... 23 24\n| | `kk` | 01 02 ... 23 24\n| Minute | `m` | 0 1 ... 58 59\n| | `mm` | 00 01 ... 58 59\n| Second | `s` | 0 1 ... 58 59\n| | `ss` | 00 01 ... 58 59\n| Fractional Second | `S` | 0 1 ... 8 9\n| | `SS` | 00 01 ... 98 99\n| | `SSS` | 000 001 ... 998 999\n| | `SSSS ... SSSSSSSSS` | 000[0..] 001[0..] ... 998[0..] 999[0..]\n| Time Zone | `z` or `zz` | EST CST ... MST PST (requires use of the `timezone` option)\n| | `Z` | -07:00 -06:00 ... +06:00 +07:00\n| | `ZZ` | -0700 -0600 ... +0600 +0700\n| Unix Timestamp | `X` | 1360013296\n| Unix Millisecond Timestamp | `x` | 1360013296123\n\n#### Localized Date Formats\n\nBecause preferred formatting differs based on locale, there are a few\ntokens that can be used to format a moment based on its locale. There\nare upper and lower case variations on the same formats. The lowercase\nversion is intended to be the shortened version of its uppercase\ncounterpart. To change the locale, use the `locale` options: `{{\nformat date format=\"LLL\" locale=\"fr\" }}` results in \"24 june 2015 17:24\".\n\n| | Format string | Output |\n| ------------------------------------ | ------------- | ----------------|\n| Time | `LT` | 8:30 PM\n| Time with seconds | `LTS` | 8:30:25 PM\n| Month numeral, day of month, year | `L` | 09/04/1986\n| | `l` | 9/4/1986\n| Month name, day of month, year | `LL` | September 4, 1986\n| | `ll` | Sep 4, 1986\n| Month name, day of month, year, time | `LLL` | September 4, 1986 8:30 PM\n| | `lll` | Sep 4, 1986 8:30 PM\n| Month name, day of month, day of week, year, time | `LLLL` | Thursday, September 4, 1986 8:30 PM\n| | `llll` | Thu, Sep 4, 1986 8:30 PM\n\n### Number Variable Formatting\n\nTo format a number, use the `format` helper: `{{ format\nlead.mortgage.first_mortgage_balance format=\"$0,0.00\"}}` results in\n'$45,302.00'. The `format` option is a string which defines the format\nof the number. See the table of examples below:\n\n| Number | Format | String |\n| ---------- | ------------ | ----------- |\n| 10000 | `0,0.0000` | 10,000.0000\n| 10000.23 | `0,0` | 10,000\n| 10000.23 | `+0,0` | +10,000\n| -10000 | `0,0.0` | -10,000.0\n| 10000.1234 | `0.000` | 10000.123\n| 100.1234 | `00000` | 00100\n| 1000.1234 | `000000,0` | 001,000\n| 10 | `000.00` | 010.00\n| 10000.1234 | `0[.]00000` | 10000.12340\n| -10000 | `(0,0.0000)` | (10,000.0000)\n| -0.23 | `.00` | -.23\n| -0.23 | `(.00)` | (.23)\n| 0.23 | `0.00000` | 0.23000\n| 0.23 | `0.0[0000]` | 0.23\n| 1230974 | `0.0a` | 1.2m\n| 1460 | `0 a` | 1 k\n| -104000 | `0a` | -104k\n| 1 | `0o` | 1st\n| 100 | `0o` | 100th\n| 1000.234 | `$0,0.00` | $1,000.23\n| 1000.2 | `0,0[.]00 $` | 1,000.20 $\n| 1001 | `$ 0,0[.]00` | $ 1,001\n| -1000.234 | `($0,0)` | ($1,000)\n| -1000.234 | `$0.00` | -$1000.23\n| 1230974 | `($ 0.00 a)` | $ 1.23 m\n\nUse the `locale` option to format the number to a particular locale:\n`{{ format lead.mortgage.first_mortgage_balance locale=\"fr\"\nformat=\"$0,0.00\" }}` results in '€45 302.00'.\n\n### Converting Number and Boolean to String\n\nFields of type number and boolean can be converted to string using the `format` helper with the `dataType=\"String\"` option:\n\n`{{format field_name dataType=\"String\"}}`\n\nExample:\n- Input: `{{format lead.age dataType=\"String\"}}` with `lead.age` = 30\n- Output: \"30\"\n\n### Converting String to Number\n\nFields whose final result from the `format` helper is a string can be converted to a number if the `dataType=\"Number\"` option is passed and the value is a string representing a valid number.\n\nExamples:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = '78751'\n- Output: 78751 (as a number value)\n\nIf the string does not represent a valid number, the result will not be converted:\n- Input: `{{format lead.postal_code dataType=\"Number\"}}` with `lead.postal_code` = 'H3Z 2Y7'\n- Output: 'H3Z 2Y7'\n\nThis can also be used with dates if the formatting returns only numbers, such as epoch time:\n- Input: `{{format lead.source_timestamp format=\"X\" dataType=\"Number\"}}` with `lead.source_timestamp` = '2015-06-24T17:24:49.060Z'\n- Output: 1435166689 (as a number value)\n\n\n## Variable String Manipulation\n\nStrings can be manipulated with the following helpers:\n\n### Lowercase\n\nTransforms the value to lowercase:\n\n`{{lowercase field_name}}`\n\nExample:\n- Input: `{{lowercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"mike\"\n\n### Uppercase\n\nTransforms the value to uppercase:\n\n`{{uppercase field_name}}`\n\nExample:\n- Input: `{{uppercase lead.first_name}}` with `lead.first_name` = \"Mike\"\n- Output: \"MIKE\"\n\n### Substring\n\nReturns a substring from the start position to the end position, or from the start position to the end of the string if no end position is provided:\n\n`{{substring field_name start=\"3\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"3\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"chael\"\n\n`{{substring field_name start=\"2\" end=\"4\"}}`\n\nExample:\n- Input: `{{substring lead.first_name start=\"2\" end=\"4\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"ich\"\n\n### Replace\n\nReplaces the pattern with the content of the replace option. The pattern can be a literal string or a regular expression using the `regexp()` option:\n\n`{{replace field_name pattern=\"Mi\" replace=\"At\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"Mi\" replace=\"At\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Atchael\"\n\n`{{replace field_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}`\n\nExample:\n- Input: `{{replace lead.first_name pattern=\"regexp(h.{3})\" replace=\"ke\"}}` with `lead.first_name` = \"Michael\"\n- Output: \"Micke\"\n\n### Extract\n\nExtracts all occurrences found with the regular expression in the pattern:\n\n`{{extract field_name pattern=\"\\$begin:math:display$(.*?)\\\\$end:math:display$\"}}`\n\nExample:\n- Input: `{{ extract foo pattern=\"(?\u003c=#)(\\\\w+)(?=#)\" }}` with `lead.first_name` = \"#John#Doe#Smith\"\n- Output: \"John Doe\"\n\n## Variable Math\n\nTo perform math operations, use the `math` helper: `{{ math \"1 + 1\" }}`\nresults in `2`. Of course, variables can also be used: `{{ math \"1 +\nlead.random_number\" }}` might result in `32` depending on the value\nof `lead.random_number`. The math expression accepts a pretty basic\ngrammar. Operators have the normal precedence:\n\n| Operator | Associativity | Description\n| ------------------------ | ------------- | ----------\n| (...) | None | Grouping\n| f(), x.y | Left | Function call, property access\n| ! | Left | Factorial\n| ^ | Right | Exponentiation\n| +, -, not, sqrt, etc. | Right | Unary prefix operators (see below for the full list)\n| \\*, /, % | Left | Multiplication, division, remainder\n| +, -, \\|\\| | Left | Addition, subtraction, concatenation\n| `==`, `!=`, `>=`, `\u003c=`, `>`, `\u003c`, `in` | Left | Equals, not equals, etc. `in` means \"is the left operand included in the right array operand?\" (disabled by default)\n| and | Left | Logical AND\n| or | Left | Logical OR\n| x ? y : z | Right | Ternary conditional (if x then y else z)\n\nThere are also several pre-defined functions:\n\n| Function | Description |\n| ------------- | ----------- |\n| sin(x) | Sine of x (x is in radians)\n| cos(x) | Cosine of x (x is in radians)\n| tan(x) | Tangent of x (x is… well, you know)\n| asin(x) | Arc sine of x (in radians)\n| acos(x) | Arc cosine of x (in radians)\n| atan(x) | Arc tangent of x (in radians)\n| sqrt(x) | Square root of x. Result is NaN (Not a Number) if x is negative.\n| log(x) | Natural logarithm of x (not base-10). It’s log instead of ln because that’s what JavaScript calls it.\n| abs(x) | Absolute value (magnitude) of x\n| ceil(x) | Ceiling of x — the smallest integer that’s >= x.\n| floor(x) | Floor of x — the largest integer that’s `\u003c=` x\n| round(x) | X, rounded to the nearest integer, using \"grade-school rounding\"\n| roundTo(x, n) | Rounds x to n places after the decimal point\n| exp(x) | ex (exponential/antilogarithm function with base e)\n| random(n) | Get a random number in the range [0, n). If n is zero, or not provided, it defaults to 1.\n| fac(n) | n! (factorial of n: “n * (n-1) * (n-2) * … * 2 * 1″)\n| min(a,b,...) | Get the smallest (“minimum”) number in the list\n| max(a,b,...) | Get the largest (“maximum”) number in the list\n| pyt(a, b) | Pythagorean function, i.e. the c in “c2 = a2 + b2“\n| pow(x, y) | xy. This is exactly the same as “x^y”. It’s just provided since it’s in the Math object from JavaScript\n| atan2(y, x) | arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians\n| if(c, a, b) | Function form of c ? a : b\n\n#### Example\n\nTo calculate the loan-to-value ratio, given a mortgage loan amount and\nthe value of the home: `{{ math \"(lead.mortgage.loan.amount /\nlead.mortgage.new_property_value) * 100\" }}%`. Note that this example\nexpresses the LTV as a percentage, first by calculating the percentage\nand then by appending the `%` character outside the variable\nplaceholder. This could instead be handled using\n[formatting](#variable-math-formatting).\n\n### Variable Math Formatting\n\nThe `math` helper supports the same options as the `format` helper for\nnumbers: `format` and `locale`. For example, to calculate the\nloan-to-value ratio and format it as a percentage: `{{ math\n\"lead.mortgage.loan.amount / lead.mortgage.new_property_value\"\nformat=\"0.[00]%\" }}`. This would return the LTV percentage with up to 2\ndecimal points (i.e. 72.93%) as a string value.\n\n## Variable Hashing\n\nLeadConduit supports a wide variety of hashing functions that can be\napplied to variables in a template. The helper name determines the\nhashing algorithm. For example, to use MD5 to hash the email address use:\n`{{ md5 lead.email }}`. All the following hashing algorithms are\nsupported:\n \n* md4\n* md5\n* ripemd\n* ripemd160\n* sha1\n* sha224\n* sha256\n* sha384\n* sha512\n* whirlpool\n \nMultiple values can be hashed together: `{{ md5 lead.email lead.phone_1 }}`. This can be used to salt the hash \nalso: `{{ md5 lead.email \"this is my salt\" }}`. The `salt` option can also be used. This is the equivalent of the \nlast example: `{{ md5 lead.email salt=\"this is my salt\" }}`. \n\nHashing supports multiple encodings using the `encoding` option:\n`{{ md5 lead.email encoding=\"base64\" }}` results in something like\n\"tkK0IXs0sejTvZFfxlxEUg==\". The following encodings are supported:\n \n* `hex` (default)\n* `base64`\n* `latin1`\n","x-tags":["Templates"],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3.items.[INDEX]","typeLabel":"string"},"description":"The right-hand value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","example":"TX","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv.oneOf.3","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rhv","typeLabel":"string | number | boolean | string[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.0","typeLabel":"Binary Rule · object"},{"type":"object","title":"Unary Rule","required":["lhv","op"],"x-tags":["Rules"],"properties":{"lhv":{"type":"string","title":"Template","description":"The value to be evaluated ([templating](https://developers.activeprospect.com/api-reference/leadconduit/templates) is supported)","x-tags":["Templates"],"example":"lead.email","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.lhv","typeLabel":"string"},"op":{"type":"string","enum":["is blank","is not blank","is true","is false","is not true","is not false","format is valid","format is invalid","is obscene","is not obscene"],"x-enumDescriptions":{"is blank":"Is the `lhv` missing or empty?","is not blank":"Does the `lhv` contain a value?","is true":"Does the `lhv` evaluate to `true`?","is false":"Does the `lhv` evaluate to `false`?","format is valid":"The `lhv` was successfully interpreted as a value of its specified type.","format is invalid":"The `lhv` could not be interpreted as a value of its specified type.","is obscene":"Does the `lhv` contain obscene language?","is not obscene":"Does the `lhv` contain no obscene language?"},"example":"is not blank","description":"Unary operators evaluate the `lhv`.\n","isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.op","typeLabel":"enum\u003cstring>"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"1aacd0","readOnly":true,"description":"ID for this rule","uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.id","typeLabel":"string"},"rule_set":{"oneOf":[{}],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.rule_set","typeLabel":"any"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","description":"Not available yet. String values that LeadConduit stores on a source, step or rule and does\nnot interpret. Keys are lowercase snake case, up to 64 characters.\n","maxProperties":20,"x-internal":true,"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1.metadata","typeLabel":"Metadata · object | null"}},"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX].oneOf.1","typeLabel":"Unary Rule · object"},{}],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules.items.[INDEX]","typeLabel":"Binary Rule · object | Unary Rule · object"},"isRequired":true,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.rules","typeLabel":"(Binary Rule · object | Unary Rule · object)[]"},"id":{"type":"string","pattern":"^[0-9a-zA-Z]{6}$","example":"0d144a","readOnly":true,"description":"The ID of the rule set in this flow","uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set.id","typeLabel":"string"}},"additionalProperties":false,"required":["op","rules"],"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX].rule_set","typeLabel":"Rule Set · object"}},"required":["amount"],"additionalProperties":false,"uniqueKey":"oneOf.6.pricing.prices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.6.pricing.prices","typeLabel":"object[]"}},"additionalProperties":false,"uniqueKey":"oneOf.6.pricing","typeLabel":"object"},"transactions":{"type":"array","description":"A list of HTTP transactions that occurred while processing the lead","items":{"type":"object","description":"An HTTP transaction initiated by the integration","properties":{"request":{"type":"object","properties":{"method":{"type":"string","description":"HTTP request method","enum":["GET","POST","PUT","DELETE","PATCH","OPTIONS"],"example":"POST","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.method","typeLabel":"enum\u003cstring>"},"uri":{"type":"string","description":"The full URI","format":"uri","example":"https://app.leadconduit.com/flows/5fd4371e940df5a34a3888b2/sources/6369a0e534c9d4ebe142e0ef/submit","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.uri","typeLabel":"string\u003curi>"},"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent on the request","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the request body","example":"{\"email\":\"johndoe@email.com\",\"phone_1\":\"5127891111\"}","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately prior to sending the request","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request.timestamp","typeLabel":"integer"}},"required":["method","uri","version","headers","body","timestamp"],"additionalProperties":false,"description":"An HTTP request sent by the integration","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].request","typeLabel":"object"},"response":{"type":"object","properties":{"version":{"type":"string","description":"The HTTP version used","example":"1.1","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response.version","typeLabel":"string"},"headers":{"type":"object","patternProperties":{"[A-Za-z0-9_\\\\-~\\\\{\\\\}]+":{"type":"string","minLength":1}},"additionalProperties":false,"description":"The headers sent in the response","example":{"Content-Type":"application/json","Accept":"application/json"},"isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response.headers","typeLabel":"object"},"body":{"type":"string","description":"The contents of the response body","example":"{\"outcome\":\"success\",\"lead\":{\"id\":\"63cc6f0e55254d7d1c4c3037\"}}","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response.body","typeLabel":"string"},"timestamp":{"type":"integer","description":"The number of milliseconds elapsed since epoch immediately after reading the response body","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response.timestamp","typeLabel":"integer"},"status":{"type":"integer","description":"HTTP status code","example":201,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response.status","typeLabel":"integer"},"status_text":{"type":"string","description":"The textual representation of the status","format":"uri","example":"Created","uniqueKey":"oneOf.6.transactions.items.[INDEX].response.status_text","typeLabel":"string\u003curi>"}},"required":["method","uri","version","headers","body","timestamp"],"description":"An HTTP response received by the integration","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].response","typeLabel":"object"},"ms":{"type":"integer","description":"The number of milliseconds that elapsed between sending request and receiving the response","isRequired":true,"uniqueKey":"oneOf.6.transactions.items.[INDEX].ms","typeLabel":"integer"}},"required":["request","response","ms"],"uniqueKey":"oneOf.6.transactions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.6.transactions","typeLabel":"object[]"}},"uniqueKey":"oneOf.6","typeLabel":"Retry Event · object"}],"uniqueKey":"","typeLabel":"Source Event · object | Recipient Event · object | Filter Event · object | Calculated Event · object | Feedback Received Event · object | Feedback Sent Event · object | Retry Event · object","example":{"title":"Example","value":{"id":"5fd4371e940df5a34a3888b2","reason":"\u003cstring>","type":"source","vars":{},"host":"\u003cstring>","start_timestamp":123,"end_timestamp":123,"ms":123,"wait_ms":123,"overhead_ms":123,"lag_ms":123,"total_ms":123,"handler_version":"\u003cstring>","version":"\u003cstring>","cap_reached":true,"flow_ping_limits":{"id":"5fd4371e940df5a34a3888b2","name":"\u003cstring>","maximum":123,"duration":123,"duration_units":"\u003cstring>","time_zone":"America/New_York","created_at":"2023-11-07T05:31:56Z"},"source_ping_limits":{"id":"5fd4371e940df5a34a3888b2","name":"\u003cstring>","maximum":123,"duration":123,"duration_units":"\u003cstring>","time_zone":"America/New_York","created_at":"2023-11-07T05:31:56Z"},"ping_limit_reached":true,"expires_at":"2023-11-07T05:31:56Z","module_id":"leadconduit-salesforce.outbound.create_contact","package_version":"\u003cstring>","step_count":4,"appended":{}}}},"originalFileLocation":"LeadConduit-API/v1/bundle/master/leadconduit_api.json"},"subdomain":"activeprospectinc","siteName":"ActiveProspect Developer Documentation","title":"Event - ActiveProspect Developer Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-03T16:52:46.322Z","originalFileLocation":"api-reference/leadconduit/leads/event.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"ActiveProspect Developer Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Event - ActiveProspect Developer Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ActiveProspect Developer Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://activeprospectinc.mintlify.app/_mintlify/api/og/v2?division=Leads\u0026amp;title=Event\u0026amp;theme=82b92e625aa25be6cc045629\u0026amp;signature=53a96ee17d0dfd90dc71ca45e4d48f3d2cc29f014b5a8ed9a6aa8b2d60b18de4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Event - ActiveProspect Developer Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://activeprospectinc.mintlify.app/_mintlify/api/og/v2?division=Leads\u0026amp;title=Event\u0026amp;theme=82b92e625aa25be6cc045629\u0026amp;signature=53a96ee17d0dfd90dc71ca45e4d48f3d2cc29f014b5a8ed9a6aa8b2d60b18de4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/activeprospectinc/-voIGRv_PaCQr-Wj/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ActiveProspect Developer Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#22a7f0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/leadconduit/leads/event.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.activeprospect.com/#organization\",\"name\":\"ActiveProspect Developer Documentation\",\"url\":\"https://developers.activeprospect.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/activeprospectinc/ttzTIJYOTNQPAJMy/logo/activeprospect_logo.svg?fit=max\u0026auto=format\u0026n=ttzTIJYOTNQPAJMy\u0026q=85\u0026s=9c7503c7631642aa1f7288ae35cc02cc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.activeprospect.com#website\",\"name\":\"ActiveProspect Developer Documentation\",\"url\":\"https://developers.activeprospect.com\",\"publisher\":{\"@id\":\"https://developers.activeprospect.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event#webpage\",\"url\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event\",\"name\":\"Event\",\"dateModified\":\"2026-11-03T16:52:46.322Z\",\"isPartOf\":{\"@id\":\"https://developers.activeprospect.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Documentation\",\"item\":\"https://developers.activeprospect.com/api-reference/leadconduit/flows/destination\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API Endpoints\",\"item\":\"https://developers.activeprospect.com/api-reference/leadconduit/flows/destination\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Leads\",\"item\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event\",\"item\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event#apireference\",\"headline\":\"Event\",\"name\":\"Event\",\"url\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event\",\"mainEntityOfPage\":{\"@id\":\"https://developers.activeprospect.com/api-reference/leadconduit/leads/event#webpage\"},\"dateModified\":\"2026-11-03T16:52:46.322Z\",\"publisher\":{\"@id\":\"https://developers.activeprospect.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.activeprospect.com#website\"}}]}\u003c/script>","siteName":"ActiveProspect Developer Documentation","nav":{"global":null,"tabs":[{"tab":"Welcome","pages":[{"title":"ActiveProspect Documentation","mode":"center","href":""}]},{"tab":"TrustedForm","pages":[{"title":"Getting Started","href":"/pages/trustedform/getting-started"},{"title":"Implementing the TrustedForm Certify Web SDK","href":"/pages/trustedform/implementing-trustedform-certify"},{"title":"Adding TrustedForm Consent Tags","href":"/pages/trustedform/consent-tagging"},{"group":"API Documentation","pages":[{"title":"Authentication","href":"/pages/trustedform/authentication"},{"group":"TrustedForm API 4.0","pages":[{"group":"Certificate URL","root":{"title":"Certificate URL","href":"/api-reference/trustedform/v4/certificate-url"},"pages":[{"title":"Run Certificate Operations","deprecated":null,"version":null,"openapi":"/api-reference/claims_api-v4.yaml post /{cert_id}","href":"/api-reference/certificate-url/run-certificate-operations"}]},{"group":"Operations","root":{"title":"Operations","href":"/api-reference/trustedform/v4/operations"},"pages":[{"group":"Match Lead","root":{"title":"Match Lead","href":"/api-reference/trustedform/v4/operations/match-lead"},"pages":[{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/MatchLeadParameters"},{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/MatchLeadResult"}]},{"group":"Retain","root":{"title":"Retain","href":"/api-reference/trustedform/v4/operations/retain"},"pages":[{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/RetainParameters"},{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/RetainResult"}]},{"group":"Insights","root":{"title":"Insights","href":"/api-reference/trustedform/v4/operations/insights"},"pages":[{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/InsightsParameters"},{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/InsightsResult"}]},{"group":"Verify","root":{"title":"Verify","href":"/api-reference/trustedform/v4/operations/verify"},"pages":[{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/VerifyParameters"},{"title":null,"href":"/api-reference/trustedform/v4/operations/schemas/VerifyResult"}]}]},{"group":"Certificate","pages":[{"title":"Types","href":"/api-reference/trustedform/v4/certificate/types"},{"title":"Sending on Ping","href":"/api-reference/trustedform/v4/certificate/sending-on-ping"}]}]},{"title":"Validate API","href":"/pages/trustedform/validating-certificates"},{"group":"TrustedForm API 3.0","pages":[{"title":"Overview","href":"/api-reference/trustedform/v3/overview"},{"group":"Retrieving Insights","pages":[{"title":"Retrieve Certificate Insights","deprecated":null,"version":null,"openapi":"/api-reference/trustedform_v3.json post /{cert_id_}","href":"/api-reference/retrieving-insights/retrieve-certificate-insights"}]},{"group":"Viewing Certificates","pages":[{"title":"Viewing a Certificate","deprecated":null,"version":null,"openapi":"/api-reference/trustedform_v3.json get /{cert_id}","href":"/api-reference/viewing-certificates/viewing-a-certificate"}]},{"group":"Claiming Certificates","pages":[{"title":"Claiming a Certificate","deprecated":null,"version":null,"openapi":"/api-reference/trustedform_v3.json post /{cert_id}","href":"/api-reference/claiming-certificates/claiming-a-certificate"}]},{"group":"TrustedForm Certificate Check-in","pages":[{"title":"Check-in","deprecated":null,"version":null,"openapi":"/api-reference/trustedform_v3.json post /{cert_id}/check_in","href":"/api-reference/trustedform-certificate-check-in/check-in"}]},{"group":"Ping","pages":[{"title":"Retrieving Ping Data","deprecated":true,"version":null,"openapi":"/api-reference/trustedform_v3.json post /{cert_id}/ping","href":"/api-reference/ping/retrieving-ping-data"},{"title":"Generate Ping URL","deprecated":true,"version":null,"openapi":"/api-reference/trustedform_v3.json get /{cert_id}/ping_url","href":"/api-reference/ping/generate-ping-url"}]}]},{"group":"TrustedForm API v2.0","pages":[{"title":"Overview","href":"/api-reference/trustedform/v2/overview"},{"group":"Ping","pages":[{"title":"Retrieve Ping Data","deprecated":true,"version":null,"openapi":"/api-reference/trustedform_v2.yaml get /{cert_id}/ping","href":"/api-reference/ping/retrieve-ping-data"}]},{"group":"Claiming Certificates","pages":[{"title":"Claiming Certificates","deprecated":null,"version":null,"openapi":"/api-reference/trustedform_v2.yaml post /{cert_id}","href":"/api-reference/claiming-certificates/claiming-certificates"}]}]}]}]},{"tab":"LeadConduit","pages":[{"title":"About","href":"/api-reference/leadconduit"},{"title":"Authentication","href":"/pages/leadconduit/authentication"},{"group":"API Documentation","pages":[{"group":"API Endpoints","pages":[{"group":"Flows","root":{"title":"Flows","href":"/api-reference/leadconduit/flows"},"pages":[{"title":null,"href":"/api-reference/leadconduit/flows/destination"},{"title":null,"href":"/api-reference/leadconduit/flows/flow"},{"title":null,"href":"/api-reference/leadconduit/flows/meta"},{"title":"Submission response","sidebarTitle":"Submission response","href":"/api-reference/leadconduit/flows/submission-response"},{"title":"Ping response","sidebarTitle":"Ping response","href":"/api-reference/leadconduit/flows/ping-response"},{"title":"List all flows","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows","href":"/api-reference/flows/list-all-flows"},{"title":"Update all flows","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /flows","href":"/api-reference/flows/update-all-flows"},{"title":"Create a new flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /flows","href":"/api-reference/flows/create-a-new-flow"},{"title":"Get a flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{id}","href":"/api-reference/flows/get-a-flow"},{"title":"Update an existing flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /flows/{id}","href":"/api-reference/flows/update-an-existing-flow"},{"title":"Delete an existing flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json delete /flows/{id}","href":"/api-reference/flows/delete-an-existing-flow"},{"title":"Deploy a saved flow to production","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /flows/{id}/deploy","href":"/api-reference/flows/deploy-a-saved-flow-to-production"},{"title":"List fields associated to the Flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{id}/fields","href":"/api-reference/flows/list-fields-associated-to-the-flow"},{"title":"Get flow field usages","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{id}/fields/usage","href":"/api-reference/flows/get-flow-field-usages"},{"title":"Retrieve metadata for a specific source within a flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{flow_id}/sources/{source_id}/meta","href":"/api-reference/flows/retrieve-metadata-for-a-specific-source-within-a-flow"},{"title":"Submit data to a source within a flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /flows/{flow_id}/sources/{source_id}/submit","href":"/api-reference/flows/submit-data-to-a-source-within-a-flow"},{"title":"Ping a source within a flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{flow_id}/sources/{source_id}/ping","href":"/api-reference/flows/ping-a-source-within-a-flow"},{"title":"Ping a source within a flow with a request body","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /flows/{flow_id}/sources/{source_id}/ping","href":"/api-reference/flows/ping-a-source-within-a-flow-with-a-request-body"}]},{"group":"Leads","root":{"title":"Leads","description":null,"href":"/api-reference/leadconduit/leads"},"pages":[{"title":null,"href":"/api-reference/leadconduit/leads/event"},{"title":"List all events","description":"The `/events` resource is used to query\n[events](https://developers.activeprospect.com/api-reference/leadconduit/leads/event)\ngenerated while handling leads. For each lead, one event is generated for\neach configured [flow\nstep](https://developers.activeprospect.com/api-reference/leadconduit/flows/flow)\nthat handles the lead. After lead processing completes, a source event\nis also recorded.\n","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /events","href":"/api-reference/leads/list-all-events"},{"title":"List all events for exports","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /events","href":"/api-reference/leads/list-all-events-for-exports"},{"title":"Fetch a single event","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /events/{id}","href":"/api-reference/leads/fetch-a-single-event"}]},{"group":"Feedback","root":{"title":"Feedback","href":"/api-reference/leadconduit/feedback"},"pages":[{"title":"Feedback submission","sidebarTitle":"Feedback submission","href":"/api-reference/leadconduit/feedback/feedback-submission"},{"title":"Feedback result","sidebarTitle":"Feedback result","href":"/api-reference/leadconduit/feedback/feedback-submission-result"},{"title":"Submit feedback for a lead","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /feedback","href":"/api-reference/feedback/submit-feedback-for-a-lead"},{"title":"Submit feedback for a lead using query parameters","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /feedback","href":"/api-reference/feedback/submit-feedback-for-a-lead-using-query-parameters"},{"title":"Submit feedback for a lead using your own record ID","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /feedback/{recipient_name}","href":"/api-reference/feedback/submit-feedback-for-a-lead-using-your-own-record-id"}]},{"group":"Exports","root":{"title":"Exports","href":"/api-reference/leadconduit/exports"},"pages":[{"title":null,"href":"/api-reference/leadconduit/exports/export"},{"title":"List all exports","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /exports","href":"/api-reference/exports/list-all-exports"},{"title":"Create an export","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /exports","href":"/api-reference/exports/create-an-export"},{"title":"Get an export","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /exports/{id}","href":"/api-reference/exports/get-an-export"},{"title":"Get a download link for an export","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /exports/{id}/file","href":"/api-reference/exports/get-a-download-link-for-an-export"}]},{"group":"Fields","pages":[{"title":null,"href":"/api-reference/leadconduit/fields/field"},{"title":null,"href":"/api-reference/leadconduit/fields/type"},{"title":"List all fields","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /fields","href":"/api-reference/fields/list-all-fields"},{"title":"Create a field","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /fields","href":"/api-reference/fields/create-a-field"},{"title":"Get a field","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /fields/{id}","href":"/api-reference/fields/get-a-field"},{"title":"Update a field","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /fields/{id}","href":"/api-reference/fields/update-a-field"},{"title":"Delete a field","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json delete /fields/{id}","href":"/api-reference/fields/delete-a-field"},{"title":"List changes to a Field","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /fields/{id}/changelogs","href":"/api-reference/fields/list-changes-to-a-field"},{"title":"List data types","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /types","href":"/api-reference/fields/list-data-types"}]},{"group":"Entities","root":{"title":"Entities","href":"/api-reference/leadconduit/entities"},"pages":[{"title":null,"href":"/api-reference/leadconduit/entities/entity"},{"title":"List all entities","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /entities","href":"/api-reference/entities/list-all-entities"},{"title":"Create an entity","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /entities","href":"/api-reference/entities/create-an-entity"},{"title":"Get an entity","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /entities/{id}","href":"/api-reference/entities/get-an-entity"},{"title":"Update an entity","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /entities/{id}","href":"/api-reference/entities/update-an-entity"},{"title":"Delete an entity","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json delete /entities/{id}","href":"/api-reference/entities/delete-an-entity"},{"title":"List changes to an Entity","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /entities/{id}/changelogs","href":"/api-reference/entities/list-changes-to-an-entity"}]},{"group":"Packages","root":{"title":"Packages","href":"/api-reference/leadconduit/packages"},"pages":[{"title":"Package","sidebarTitle":"Package","href":"/api-reference/leadconduit/packages/package"},{"title":"List all integration packages","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /packages","href":"/api-reference/packages/list-all-integration-packages"},{"title":"Fetch a single integration package","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /packages/{id}","href":"/api-reference/packages/fetch-a-single-integration-package"}]},{"group":"Changelogs","root":{"title":"Changelogs","href":"/api-reference/leadconduit/changelogs"},"pages":[{"title":null,"href":"/api-reference/leadconduit/changelogs/changelog"},{"title":"List all changelogs","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /changelogs","href":"/api-reference/changelogs/list-all-changelogs"},{"title":"Get a changelog","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /changelogs/{id}","href":"/api-reference/changelogs/get-a-changelog"},{"title":"List changes to a Flow","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /flows/{id}/changelogs","href":"/api-reference/changelogs/list-changes-to-a-flow"}]},{"group":"Reports","pages":[{"title":null,"href":"/api-reference/leadconduit/reports/report"},{"title":"List all reports","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /reports","href":"/api-reference/reports/list-all-reports"},{"title":"Create a new report","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /reports","href":"/api-reference/reports/create-a-new-report"},{"title":"Fetch a single report","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /reports/{id}","href":"/api-reference/reports/fetch-a-single-report"},{"title":"Update an existing report","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /reports/{id}","href":"/api-reference/reports/update-an-existing-report"},{"title":"Delete a report","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json delete /reports/{id}","href":"/api-reference/reports/delete-a-report"},{"title":"Run a report","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /reports/{id}/run","href":"/api-reference/reports/run-a-report"}]},{"group":"Caps and Limits","root":{"title":"Caps and Limits","href":"/api-reference/leadconduit/caps-and-limits"},"pages":[{"title":null,"href":"/api-reference/leadconduit/caps-and-limits/cap"},{"title":null,"href":"/api-reference/leadconduit/caps-and-limits/cap-counter"},{"title":null,"href":"/api-reference/leadconduit/caps-and-limits/pinglimit"},{"title":null,"href":"/api-reference/leadconduit/caps-and-limits/pinglimit-counter"},{"title":"List all cap counters","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /caps","href":"/api-reference/caps-and-limits/list-all-cap-counters"},{"title":"Get a cap counter","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /caps/{id}","href":"/api-reference/caps-and-limits/get-a-cap-counter"},{"title":"List all ping limit counters","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /ping_limits","href":"/api-reference/caps-and-limits/list-all-ping-limit-counters"},{"title":"Fetch a ping limit counter","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /ping_limits/{id}","href":"/api-reference/caps-and-limits/fetch-a-ping-limit-counter"}]},{"group":"Firehose","root":{"title":"Firehose","href":"/api-reference/leadconduit/firehose"},"pages":[{"title":"Test firehose's ability to write to AWS S3 or Azure Blob Storage","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /firehose","href":"/api-reference/firehose/test-firehoses-ability-to-write-to-aws-s3-or-azure-blob-storage"}]},{"group":"Routers","pages":[{"title":null,"href":"/api-reference/leadconduit/router"},{"title":"List all routers","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /routers","href":"/api-reference/routers/list-all-routers"},{"title":"Create a router","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /routers","href":"/api-reference/routers/create-a-router"},{"title":"Get a router","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /routers/{id}","href":"/api-reference/routers/get-a-router"},{"title":"Update a router","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /routers/{id}","href":"/api-reference/routers/update-a-router"},{"title":"Submit a lead to a router","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /routers/{router_id}/route","href":"/api-reference/routers/submit-a-lead-to-a-router"},{"title":"Submit a lead to a router using query parameters","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /routers/{router_id}/route","href":"/api-reference/routers/submit-a-lead-to-a-router-using-query-parameters"}]},{"group":"Account","root":{"title":"Account","href":"/api-reference/leadconduit/account"},"pages":[{"title":null,"href":"/api-reference/leadconduit/account/account"},{"title":null,"href":"/api-reference/leadconduit/account/credential"},{"title":"Get account","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /account","href":"/api-reference/account/get-account"},{"title":"Update account","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /account","href":"/api-reference/account/update-account"},{"title":"List all credentials","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /credentials","href":"/api-reference/account/list-all-credentials"},{"title":"Create a new credential","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /credentials","href":"/api-reference/account/create-a-new-credential"},{"title":"Get a credential","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /credentials/{id}","href":"/api-reference/account/get-a-credential"},{"title":"Update a credential","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json put /credentials/{id}","href":"/api-reference/account/update-a-credential"},{"title":"Delete a credential","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json delete /credentials/{id}","href":"/api-reference/account/delete-a-credential"}]},{"group":"Connections","root":{"title":"Connections","href":"/api-reference/leadconduit/connections"},"pages":[{"title":"List connections","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /connections","href":"/api-reference/connections/list-connections"},{"title":"Repair: materialize a missing LC connection","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json post /connections","href":"/api-reference/connections/repair:-materialize-a-missing-lc-connection"},{"title":"Get connection by ID","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /connections/{id}","href":"/api-reference/connections/get-connection-by-id"}]},{"group":"System","pages":[{"title":null,"href":"/api-reference/leadconduit/system/status"},{"title":"Get system status","deprecated":null,"version":null,"openapi":"/api-reference/leadconduit_api.json get /status","href":"/api-reference/system/get-system-status"}]}]}]},{"group":"Concepts","pages":[{"group":"Rules","root":{"title":"Rules","href":"/api-reference/leadconduit/rules"},"pages":[{"title":null,"href":"/api-reference/leadconduit/rules/rule"},{"title":null,"href":"/api-reference/leadconduit/rules/rule-set"}]},{"group":"Variables","root":{"title":"Variables","href":"/api-reference/leadconduit/variables"},"pages":[{"title":null,"href":"/api-reference/leadconduit/variables/variables"}]},{"title":"Types","href":"/api-reference/leadconduit/types"},{"title":"Templates","href":"/api-reference/leadconduit/templates"}]}]}]},"basePath":"","title":"Event - ActiveProspect Developer Documentation","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C8RPHPxo.js","utils-0BK-9q6z.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DfjzsUJT.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B4v9psJ4.js","snippetPresets-CpTQv-Ez.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BNP-Fvr0.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BSgu6h1D.js","shallow-Biv1i9Gs.js","getApiPlaygroundDisplay-BoGOXhtF.js","CodeSnippet-DvQoT18_.js","CodeSnippets-Dnpa15xT.js","Page-Buji1S4J.js","getPastedJson-xAIyhUFE.js","icon-S6FBih11.js","MethodPill-SaYeUZyk.js","DuplicateIcon-Cs-p3v2Q.js","createIcon-DjCFEoHq.js","DynamicMarkdown-BcnBltEQ.js","SectionHeading-BUBl0eEF.js","axios-vUo_bRtp.js","Markdown-h4cOoD8d.js","clsx-B2v50t8t.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DJnKvr0g.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BHrrjR1K.js"]}