Create Salesforce leads from landing page API calls

Recipe ToolsCRMMarketingDeveloper ToolAPI Integration

What it does

When someone makes a call to the Landing Page Lead API, this automation validates the campaign data in the request. It searches Salesforce for matching campaigns and returns a response so the caller knows whether lead creation can proceed.

Who it's for

Marketing operations teams who need to create Salesforce leads from landing page submissions via API.

How teams use this

Validate campaigns before lead sync

Check that all required campaign fields exist and the campaign is valid in Salesforce before accepting the lead from the landing page. This prevents orphaned leads tied to missing campaigns.

Reject invalid requests with error details

Return a clear error response when campaign data is incomplete or the campaign does not exist in Salesforce. Include the missing field name so the caller knows exactly what to fix.

Route leads by campaign status

Only create leads for campaigns with an active status, and route others to a review queue. Set a condition to check the campaign status before proceeding with lead creation.

How it works

  1. Receive the landing page lead API call. Someone sends a request to the Landing Page Lead API with campaign and contact information for processing.
  2. Check for required campaign fields. Verify that the campaign ID, campaign name, and campaign status are all present in the request. Stop and return an error if any are missing.
  3. Search for the campaign in Salesforce. Look up the campaign in Salesforce to confirm it exists and is valid before proceeding with lead creation.
  4. Return the API response. Send back a response to the caller indicating whether the campaign was found and the lead can be created.