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

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

campaign_idinteger required

The campaign ID to add the leads to.

audience_idinteger nullable

The audience ID to add the leads to.

callback_urlstring nullable

Optional callback URL.

send_emailboolean nullable

Send the configured email for each upserted lead. Defaults to false.

is_generate_ai_analysisboolean nullable

Whether to generate AI analysis for the leads.

enrich_databoolean nullable

Enrich the leads from their email/domain.

generate_ai_variablesboolean nullable

Generate AI variable values for the leads. Defaults to false.

Example request

{
  "from": "MyCompanyName",
  "campaign_id": 1,
  "audience_id": 1,
  "callback_url": "https://example.com/callback",
  "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": "9f1c8b2e-..."
}

Changes

Changed in 2 of the 3 revisions of this API.27

  • 29a37db12acb24See the full diff
    • added the new required request property leads/items/values

      new-required-request-property

    • the leads/items/ request property type/format changed from string/ to object/

      request-property-type-changed

    • added the new optional request property leads/items/genpage_url

      new-optional-request-property

    • added the new optional request property leads/items/lead_id

      new-optional-request-property

    • the request property audience_id became optional

      request-property-became-optional

    • the request property from became optional

      request-property-became-optional

    • added the new optional request property enrich_data

      new-optional-request-property

    • added the new optional request property generate_ai_variables

      new-optional-request-property

    • added the new optional request property send_email

      new-optional-request-property

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog