Welcome to the Instantly API v2 guide! In this tutorial, we’ll show you how to automate lead management workflows with ease. Whether you’re a developer looking to streamline CSV uploads or a growth marketer aiming to scale campaigns, this guide is for you.
Manually uploading CSV files and verifying emails is a thing of the past. With Instantly’s API v2, you can:
- Automate repetitive tasks like CSV uploads.
- Verify email addresses before ingestion.
- Control access with scoped API keys.
- Test safely using the mock server (no real data, no risk).
Instantly’s API is designed to save you time and reduce errors, so you can focus on what matters: growing your business.
In this guide, we’ll create a Python script that:
- Creates a Lead List.
- Reads a local CSV file (
name,email). - Verifies each email address.
- Creates leads linked to the list.
- Prints a summary of the process.
Note: We’ll use the official mock API for a zero-risk demo. Switch one environment variable to hit production later.
Before you begin, ensure you have the following:
- Python 3.10+
- An Instantly API key (with minimal scopes for this demo)
- The
requestslibrary installed
-
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows use source venv/Scripts/activate pip install -r requirements.txt
-
Set the required environment variables:
export INSTANTLY_API_KEY="your_api_key" export MOCK=1 or true # Use mock server: https://developer.instantly.ai/_mock/api/v2
-
Run the script:
python main.py
Here’s a quick overview of the API calls we’ll use:
POST /lead-lists: Create a target lead list.POST /email-verification: Validate each email address before upload.POST /leads: Attach verified leads to the list.
When you run the script, you’ll see output like this:
✅ Lead list created: 019a0e4f-2924-7fb9-9775-0942f3d3219d
🔍 [email protected] -> valid
✅ 10 leads uploaded successfully
- Comprehensive Documentation: Get started quickly with clear examples.
- Mock Server: Test your integration without touching production data.
- Scalable API: Designed to handle high-volume campaigns effortlessly.
For more details, visit our official documentation.
Have questions or need support? Join our developer community:
Let’s build something amazing together!