---
title: "Add or update a lead by linkedin_url (e.g. 'john-doe' or 'linkedin.com/in/john-doe'). Creates if not found, updates stat"
method: POST
path: "/api/v1/leads/upsert"
tags: ["leads"]
---

# Add or update a lead by linkedin_url (e.g. 'john-doe' or 'linkedin.com/in/john-doe'). Creates if not found, updates stat

`POST /api/v1/leads/upsert`

## Request

- Base URL: `https://crispy.sh`
- URL: `https://crispy.sh/api/v1/leads/upsert`
- Auth: HTTP bearer

## Request body

- object
  - `lookup` object: Structured contact identifier. Resolver picks the highest-priority field per RESOLVER-09 (crispy_id > linkedin_provider_id > external_id > linkedin_url > email).
    - `crispy_id` string: Crispy contact UUID (cnt_ prefixed or raw UUID)
    - `linkedin_provider_id` string: LinkedIn provider ID (ACoAA... or ACwA... variant)
    - `linkedin_url` string: LinkedIn URL or slug (e.g. 'john-doe' or full https URL)
    - `email` string: Email address (lowercased before resolution)
    - `external_id` string: Namespaced external ID (e.g. HubSpot contact ID). Requires external_id_namespace.
    - `external_id_namespace` string: Namespace for external_id (e.g. 'hubspot', 'salesforce', 'clay')
  - `linkedin_url` string: LinkedIn profile URL or slug (e.g. 'john-doe' or 'linkedin.com/in/john-doe'). [Deprecated: use lookup.linkedin_url]
  - `status` string: Lead status to set (e.g. new, contacted, replied, qualified).
  - `first_name` string: First name.
  - `last_name` string: Last name.
  - `email` string: Email address.
  - `company` string: Company name.
  - `title` string: Job title.
  - `tags` string[]: Tags for categorization.
  - `custom_attrs` object: Custom personalization variables (max 100 string keys, 1KB total). Used in templates as {key}. Merged with existing.
  - `external_ids` object: Stable third-party identifiers (CRM IDs, enrichment IDs). Keys ending in _id are auto-populated from CSV imports.

## Response `200`

Success

## Other responses

- `401`: Missing or expired API key
- `403`: Insufficient key scope or permission denied
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/crispy/apis/crispy-rest-api.md) · [All operations](https://skmtc.dev/crispy/apis/crispy-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crispy/apis/crispy-rest-api/revisions/6bed0974d9ce?raw)
