How can I use the API?

You can use the LeadSwift REST API to automate your tasks.

You can generate and manage your API keys here. A sample PHP file with the below functions can be downloaded here.

CAMPAIGNS

Get all campaigns list:

GET
https://leadswift.com/api/campaigns?api_key=[api_key]

Get campaign by ID:

GET
https://leadswift.com/api/campaigns/[id]?api_key=[api_key]

Create a campaign:

POST
https://leadswift.com/api/campaigns?api_key=[api_key]
  • Params: title, description (optional)

Edit a campaign:

PUT
https://leadswift.com/api/campaigns/[id]?api_key=[api_key]
  • Params: campaign_id, title, description (optional)

Delete a campaign:

DELETE
https://leadswift.com/api/campaigns/[id]?api_key=[api_key]
SEARCH QUERIES

Get searches of a campaign:

GET
https://leadswift.com/api/searches/[id]?api_key=[api_key]

Submit a search:

POST
https://leadswift.com/api/searches?api_key=[api_key]
  • Params: campaign_id, keyword, location, search_html_code (optional)

Delete a search:

DELETE
https://leadswift.com/api/searches/[id]?api_key=[api_key]
GET LEADS OF A SEARCH

Get leads:

POST
https://leadswift.com/api/leads?api_key=[api_key]
  • Params: search_id, start (Paging offset, the total offset is returned in [recordsFiltered] value), length (Number of leads per page), search[value], search[regex], custom_filter, exact_match_location, exclude_closed_location, merge_by_domain, exact_match_domain_only, social_profiles, whois, free_providers, cols[]
USER INFO, USER PACKAGES

Get user info:

GET
https://leadswift.com/api/user_info?api_key=[api_key]
USER SETTINGS

Get current settings:

GET
https://leadswift.com/api/user_settings?api_key=[api_key]

Update user settings:

PUT
https://leadswift.com/api/user_settings?api_key=[api_key]
  • Params: notification_email, zerobounce_api_key, neverbounce_api_key, emaillistverify_api_key, mailtester_api_key, hunterio_api_key, debounce_api_key, zerobounce_api_enable, neverbounce_api_enable, emaillistverify_api_enable, mailtester_api_enable, verify_database contacts, hunterio_api_enable, debounce_api_enable, email_verification, email_verification_only_email, email_finder, disable_notification_email, audit_logo, audit_url, unsubscribe_url, trackmail_url, custom_global_blacklist_emails, maximum_emails_per business, maximum_emails_per business export, auto_update_global_blacklist_emails, smtp[0][smtp_id], smtp[0][sender_name], smtp[0][smtp_host], smtp[0][smtp_port], smtp[0][smtp_encryption], smtp[0][smtp_auth], smtp[0][smtp_username], smtp[0][smtp_password], smtp[0][email_signature], smtp[0][maximum_emails_per day], smtp[0][maximum_emails_per hour], smtp[0][delay_between_emails], smtp[0][delay after x_errors]
Note: Change [0] to another number [1] if it's a different SMTP.
EXPORTING LEADS

Start export:

POST
https://leadswift.com/api/export_leads_begin?api_key=[api_key]
  • Params: search_id (required), export_csv_params (required)
Note: To obtain the export_csv_params, follow these steps:
 
  1. Start an export with your desired filters in the UI
  2. Monitor the network requests to capture the POST request payload containing the export_csv_params
  3. Use it in the API
  4. Keep the cron_id returned for checking export status

The payload will vary depending on your export settings but will look something like this:

Check status of the export based on the cron_id:

POST
https://leadswift.com/api/export_leads_status?api_key=[api_key]
  • Params: cron_id (required)
Note: When finished with status Completed, it will return file_download in JSON format
GET CONTACTS OF A LEAD

Get leads:

GET
https://leadswift.com/api/load_contacts?api_key=[api_key]&id=[business_id]-[keyword_id]-[search_id]&page=1&per_page=20
  • Params: id, page, per_page, exact_match_domain_only, social_profile, whois, free_provider, q (search keyword),