Leads

Create or update a lead

Matches on identity: when a LinkedIn or Instagram identity already belongs to a lead, the fields sent are patched onto that lead and it is returned as "matched"; otherwise a lead is created. Needs a LinkedIn or Instagram identity to match on. Same identity formats as POST /leads.

POST

/api/v1/leads/upsert

Request bodyrequired

identitiesrequired

object

linkedinoptional

string

Public identifier (john-doe), /in/ path (/in/john-doe or in/john-doe), profile URL (https://www.linkedin.com/in/john-doe), or user id (ACoAAA…). Stored as the identifier, not the URL.

instagramoptional

string

Username (john-doe), handle (@john-doe), or profile URL (https://www.instagram.com/john-doe). Stored as the username without @.

timezonerequired

string

firstNameoptional

string

lastNameoptional

string

companyNameoptional

string

companyDomainoptional

string

jobTitleoptional

string

emailoptional

string

imageUrloptional

string

propertiesoptional

object

Response

200The created or matched lead.

status

"created" | "matched"

created: a new lead. matched: an identity already belonged to this lead, so the fields sent were patched onto it.

lead

object

id

string · uuid

firstName

string | null

lastName

string | null

companyName

string | null

companyDomain

string | null

jobTitle

string | null

email

string | null

imageUrl

string | null

timezone

string

identities

object[]

liveEnrollment

object | null

campaignId

string · uuid

campaignName

string

status

"active" | "waiting" | "completed" | "stopped" | "failed"

createdAt

string · date-time

updatedAt

string · date-time

properties

object

enrollments

object[]

requestId

string · uuid

Id of this request, for support and troubleshooting

Errors

  • 400: Bad request
  • 401: Unauthorized: missing or invalid API key
  • 403: Forbidden
  • 404: Not found
  • 422: Invalid request payload

Search docs

Search documentation, API reference, and MCP tools

We use cookies to enhance your experience on Needle and keep your data secure. Privacy Policy