Skip to main content

How can I use La Growth Machine’s API to automate my workflows?

Learn how to access the API, create leads, automate reporting, and overcome validation rules.

Alexia Weber avatar
Written by Alexia Weber
Updated yesterday

Overview

La Growth Machine’s API helps you automate lead creation, enrich your data, and build dashboards or integrations that fit your workflow. Whether you're pushing leads from Sheets, fetching campaign stats, or integrating with Zapier, this guide walks you through everything you need, including required fields, workarounds for validation, and where to find your API key.

Key benefits:

  • Automate lead creation directly from tools like Google Sheets or your CRM.

  • Use flexible endpoints to send and retrieve campaign or lead data.

  • Retrieve performance metrics to monitor open, click, bounce, and reply rates.

  • Overcome validation requirements with safe workarounds when you don’t have a real email.

  • Access your API key easily and use it securely across workflows.

  • Build automated reporting with Zapier and Google Sheets.


Using the La Growth Machine API

API availability by plan

The API is available starting from the Pro plan.

  • Basic plan: Email + LinkedIn connection only (no API, no Zapier, no Clay/Phantombuster).

  • Pro plan: API access, Zapier integration, Clay, Phantombuster, unlimited webhooks.

  • Ultimate plan: Everything in Pro plus unlimited integrations.

How to find your API key

You can access your API key from your workspace:

  1. Go to All settings

  2. Select Integrations & API

  3. Open the API tab

You will find: your API documentation, API key, and API logs.

Important: Do not share your API key with anyone. Regenerate it immediately if you suspect it was exposed.

Creating leads using the API

Lead creation endpoint

You must use this endpoint to create a lead:

POST https://apiv2.lagrowthmachine.com/flow/leads?apikey=Your-external-apikey

Alternatively, you can pass the key in the header:

x-api-key: Your-external-apikey

Required fields for creating a lead

You need to specify at least one of the following:

  • audience + proEmail, OR

  • persoEmail, OR

  • linkedinUrl, OR

  • twitter, OR

  • firstName + lastName + (companyUrl OR companyName)

Here is an example:

{
"firstName": "John",
"lastName": "Doe",
"persoEmail": "[email protected]",
"companyName": "ACME",
"linkedinUrl": "https://linkedin.com/in/johndoe",
"tags": ["from-api"]
}

You may see this error if the email is missing or invalid:

{"error": "ValidationError: \"persoEmail\" must be a valid email"}

For technical reasons, our API requires a valid email address when a lead is created, even if you do not intend to contact the lead via email initially.

You can pass a generic placeholder email such as:

{
"firstName": "John",
"lastName": "Doe",
"persoEmail": "[email protected]"
}

This creates the lead successfully.
Later, during enrichment, LGM will automatically retrieve the real professional email if available on LinkedIn.

Automating lead creation with Google Sheets

Using Google Apps Script

This script:

  • Reads a Google Sheet

  • Converts each row into a JSON object

  • Sends it to the lead creation endpoint

  • Writes OK or ERROR per row

function createLeadsInLGM() {
const API_KEY = "YOUR_API_KEY";
const SHEET_NAME = "Leads";
const url = "https://apiv2.lagrowthmachine.com/flow/leads?apikey=" + API_KEY;

const sheet = SpreadsheetApp.getActive().getSheetByName(SHEET_NAME);
const data = sheet.getDataRange().getValues();
const headers = data.shift();

data.forEach((row, index) => {
const lead = {};

headers.forEach((header, i) => {
const value = row[i];
if (value !== "") {
lead[header] = value;
}
});

try {
const response = UrlFetchApp.fetch(url, {
method: "post",
contentType: "application/json",
payload: JSON.stringify(lead),
});

const result = JSON.parse(response.getContentText());
Logger.log("Lead created: " + JSON.stringify(result));
sheet.getRange(index + 2, headers.length + 1).setValue("OK");

} catch (err) {
Logger.log("Error: " + err);
sheet.getRange(index + 2, headers.length + 1).setValue("ERROR");
}
});
}

Minimal version (email + firstname + lastname)

const lead = {
email: row[0],
firstname: row[1],
lastname: row[2]
};

Using the campaign stats API

Campaign stats endpoint

GET https://apiv2.lagrowthmachine.com/flow/campaigns/:campaignId/stats?apikey=YOUR_API_KEY

This endpoint returns performance metrics including:

  • Open rate

  • Click rate

  • Reply rate

  • Bounce rate

  • Number of leads reached

  • Steps completed

Automating weekly stats reporting with Zapier

Setting up the workflow with Zapier in four steps only

  1. Choose your trigger:

Use Zapier Schedule, choose to trigger this zap every Monday at 9am for example.

2. Next, API request:

Use Webhooks by Zapier (GET):

https://apiv2.lagrowthmachine.com/flow/campaigns/:campaignId/stats?apikey=YOUR_API_KEY

3. Then, format the response:

Extract open, click, reply, bounce, reached, steps.

4. Finally, send the data to your Google Sheets

Append one row per week per campaign and add conditional formatting to color code rows :

  • Green if reply rate > 8%

  • Red if bounce rate > 10%

  • Orange if open rate < 40%

You now have a live dashboard of your outbound performance, updated weekly, and structured to highlight what works and what doesn’t. It’s especially useful for comparing personas, testing sequences, and reporting to leadership with clarity!


FAQs

Do I need a valid email address to create a lead?

Yes. For technical reasons, the API requires a valid email at creation. You can use a placeholder such as *[email protected]*, and enrichment will later retrieve the real professional email.

Which fields are mandatory when creating a lead through the API?

You must provide at least one of the following: audience + proEmail, persoEmail, linkedinUrl, twitter, or firstName + lastName + (companyUrl or companyName)

Is API access included in all plans?

No. The API is available from the Pro plan and higher.

Can I automate reporting using campaign stats?

Yes! You can fetch campaign stats via API and build weekly dashboards using Zapier + Google Sheets.

Did this answer your question?