Leads

Upsert (update or create) a single lead.

This endpoint is used to upsert a single lead.

The "values" object requires at least one of the following fields, otherwise it will throw an error:

  • first_name
  • email
  • company_name
  • company_domain
  • linkedin_profile_url
post/api/external/v1/leads/upsert-lead

Request body

fromstring nullable

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

campaign_idinteger required

The campaign ID to add the lead to.

audience_idinteger nullable

An audience to add the lead to.

callback_urlstring nullable

Optional callback URL.

send_emailboolean nullable

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

is_generate_ai_analysisboolean nullable

Whether to generate AI analysis for the lead.

enrich_databoolean nullable

Enrich the lead from their email/domain.

generate_ai_variablesboolean nullable

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

lead_idinteger nullable

The GenPage Lead ID for updating existing leads.

genpage_urlstring nullable

The GenPage URL for updating existing leads.

valuesobject nullable required

Object containing key/value pairs with the lead data. You can send any key/value (value can be a string or a number) pairs that you want to add to the lead.

Example request

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

    • the request property from became optional

      request-property-became-optional

  • dd3f47f72f7a17See the full diff
    • removed the optional property genpage_url from the response with the 200 status

      response-optional-property-removed

    • added the new optional request property audience_id

      new-optional-request-property

    • 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

    • added the non-success response with the status 404

      response-non-success-status-added

    • removed the non-success response with the status 503

      response-non-success-status-removed

    • added the optional property job_id to the response with the 200 status

      response-optional-property-added

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