v1

latestOpenAPI 3.0.32026-08-0615026.5 KB
Leads

Upsert leads.

This endpoint is used to upsert (update or insert) leads.

The leads are sent in the request body. The leads are an array of objects. The leads.*.values are key/value pairs with the values of the lead.


Required fields for creating or updating a lead

To create a new lead, at least one of:

  • email
  • linkedin_profile_url

To update an existing lead, at least one of:

  • lead_id (GenPage Lead ID)
  • genpage_url (GenPage URL)

Optional but strongly recommended fields

  • first_name
  • company_name
  • company_domain

The response is the job ID.

The job ID can be used to get the status of the job, and get all the leads that were upserted by this request.

post/api/external/v1/leads/upsert-leads

Request body

fromstring nullable required

The service that is sending the leads, use your own company/service name please.

campaign_idinteger required

The campaign ID to add the leads to.

audience_idinteger nullable required

The audience ID to add the leads to.

callback_urlstring nullable

Must be a valid URL.

is_generate_ai_analysisboolean nullable

Whether to generate AI analysis for the leads.

leadsstring[] required

Array of lead objects to upsert.

Example request

{
  "from": "MyCompanyName",
  "campaign_id": 1,
  "audience_id": 1,
  "callback_url": "http://bailey.com/",
  "is_generate_ai_analysis": true,
  "leads": [
    {
      "lead_id": 16,
      "genpage_url": "https://myworkspace.genpa.ge/aws-john",
      "values": {
        "first_name": "John",
        "email": "john@aws.com",
        "company_name": "Amazon Web Services",
        "linkedin_profile_url": "https://www.linkedin.com/in/john-doe-1234567890"
      }
    }
  ]
}

Response

job_idstring

Example response

{
  "job_id": "1234567890"
}