---
title: "Upsert (update or create) a single lead."
method: POST
path: "/api/external/v1/leads/upsert-lead"
tags: ["Leads"]
---

# Upsert (update or create) a single lead.

`POST /api/external/v1/leads/upsert-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

## Request body

- object
  - `from` string, nullable — The service that is sending the lead, use your own company/service name please. Defaults to NOT_SPECIFIED.
  - `campaign_id` integer, required — The campaign ID to add the lead to.
  - `audience_id` integer, nullable — An audience to add the lead to.
  - `callback_url` string, nullable — Optional callback URL.
  - `send_email` boolean, nullable — Send the configured email for the upserted lead. Defaults to false.
  - `is_generate_ai_analysis` boolean, nullable — Whether to generate AI analysis for the lead.
  - `enrich_data` boolean, nullable — Enrich the lead from their email/domain.
  - `generate_ai_variables` boolean, nullable — Generate AI variable values for the lead. Defaults to false.
  - `lead_id` integer, nullable — The GenPage Lead ID for updating existing leads.
  - `genpage_url` string, nullable — The GenPage URL for updating existing leads.
  - `values` object, 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.

## Response `200`

- object
  - `job_id` string

## Other responses

- `400`
- `401`
- `404`

## Changes

- **2026-08-18** `29a37db12acb` — 1 info
  - the request property `from` became optional
- **2026-08-17** `dd3f47f72f7a` — 1 warning, 7 info
  - removed the optional property `genpage_url` from the response with the `200` status
  - added the new optional request property `audience_id`
  - added the new optional request property `enrich_data`
  - added the new optional request property `generate_ai_variables`
  - …4 more

[Change history](https://skmtc.dev/genpage/apis/genpage-external-api-documentation/changes/api/external/v1/leads/upsert-lead/post.md)

---

[API](https://skmtc.dev/genpage/apis/genpage-external-api-documentation.md) · [All operations](https://skmtc.dev/genpage/apis/genpage-external-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/genpage/genpage-external-api-documentation/revisions/29a37db12acb/schema)
