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:
GEThttps://leadswift.com/api/campaigns?api_key=[api_key]
Get campaign by ID:
GEThttps://leadswift.com/api/campaigns/[id]?api_key=[api_key]
Create a campaign:
POSThttps://leadswift.com/api/campaigns?api_key=[api_key]
- Params: title, description (optional)
Edit a campaign:
PUThttps://leadswift.com/api/campaigns/[id]?api_key=[api_key]
- Params: campaign_id, title, description (optional)
Delete a campaign:
DELETEhttps://leadswift.com/api/campaigns/[id]?api_key=[api_key]
SEARCH QUERIES
Get searches of a campaign:
GEThttps://leadswift.com/api/searches/[id]?api_key=[api_key]
Submit a search:
POSThttps://leadswift.com/api/searches?api_key=[api_key]
- Params: campaign_id, keyword, location, search_html_code (optional)
Delete a search:
DELETEhttps://leadswift.com/api/searches/[id]?api_key=[api_key]
GET LEADS OF A SEARCH
Get leads:
POSThttps://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:
GEThttps://leadswift.com/api/user_info?api_key=[api_key]
USER SETTINGS
Get current settings:
GEThttps://leadswift.com/api/user_settings?api_key=[api_key]
Update user settings:
PUThttps://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:
POSThttps://leadswift.com/api/export_leads_begin?api_key=[api_key]
- Params: search_id (required), export_csv_params (required)
Note: To obtain the
The payload will vary depending on your export settings but will look something like this:
export_csv_params, follow these steps:- Start an export with your desired filters in the UI
- Monitor the network requests to capture the POST request payload containing the
export_csv_params - Use it in the API
- Keep the
cron_idreturned 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:
POSThttps://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 formatGET CONTACTS OF A LEAD
Get leads:
GEThttps://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),