Skip to main content
POST
/
companies
Add and update company
curl --request POST \
  --url https://api.lemlist.com/api/companies \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Acme Corp",
  "domain": "acme.com",
  "linkedinUrl": "https://linkedin.com/company/acme",
  "industry": "Technology",
  "location": "San Francisco, CA"
}
'
{
  "success": true,
  "data": {
    "_id": "cpn_8H6uDPbNcNfZjkcSP",
    "teamId": "tea_b4rMsi2trB42WyuWP",
    "domain": "acme.com",
    "fields": {
      "name": "Acme Corp",
      "industry": "Technology",
      "location": "San Francisco, CA"
    },
    "ownerId": "usr_gmHgNGRcGPSTJrDbT",
    "source": "api",
    "createdAt": "2025-10-28T00:40:37.917Z",
    "createdBy": "usr_gmHgNGRcGPSTJrDbT",
    "created": false,
    "updated": true
  }
}
Creates a new company in your CRM, or updates an existing one if a company with the same domain, linkedinUrl, or linkedinUrlSalesNav already exists (upsert). During updates, only non-empty fields are applied — null or empty values are ignored to preserve existing data.

Upsert matching

The endpoint matches existing companies by:
IdentifierDescription
companyIdExisting company ID — updates a specific company directly, bypassing domain/LinkedIn matching
domainCompany website domain (e.g. lemlist.com) — primary unique key
linkedinUrlLinkedIn company page URL — alternative unique key
linkedinUrlSalesNavLinkedIn Sales Navigator company URL — alternative unique key
If a company with the same domain, linkedinUrl, or linkedinUrlSalesNav already exists, the endpoint updates it instead of creating a duplicate. When companyId is provided, the company is matched by its ID directly — name and domain are not required and are not used for matching (they are stored as data if provided). Without companyId, both name and domain remain required.
companyId can only be used to update an existing company. It cannot be used to create a new company — use name and domain for creation.

Owner assignment

You can assign an owner to the company using the companyOwner field. Accepted formats:
FormatExample
User IDusr_2aB3cD4eF5gH6iJ7k
Team member emailjohn@yourcompany.com
If the provided value does not match a team member (invalid format, unknown email, or unknown user ID), the owner is silently ignored — no error or warning is returned. On creation, the company defaults to the API key owner.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
companyId
string

Existing company ID. Updates a specific company by ID, bypassing domain/LinkedIn matching. Can only be used to update an existing company, not to create a new one. When provided, name and domain become optional.

name
string

Company name. Required unless companyId is provided.

domain
string

Company website domain (e.g. lemlist.com). Used as a unique key for upsert matching. Required unless companyId is provided.

linkedinUrl
string

LinkedIn company page URL. Used as an alternative unique key for upsert matching.

linkedinUrlSalesNav
string

LinkedIn Sales Navigator company URL. Used as an alternative unique key for upsert matching.

companyOwner
string

Owner of the company. Can be a user ID (e.g. usr_...) or a team member's email address. If the provided value does not match a team member, the owner defaults to the API key owner.

industry
string

Industry sector of the company.

location
string

Geographic location of the company.

size
string

Company size.

specialties
string

Company specialties.

tagline
string

Company tagline.

type
string

Company type.

description
string

Company description.

foundedOn
string

Company founding date.

headquarters
string

Company headquarters location.

picture
string

URL of the company logo or picture.

source
string
default:api

Origin of the company record. Set on creation only and cannot be updated afterwards. Defaults to api.

{key}
any

Any additional key is treated as a custom field. Custom fields must be registered in the team's CRM field registry beforehand.

Response

Existing company updated (upsert matched by domain or LinkedIn URL)

success
boolean
data
object

Same shape as the 201 response, with created: false and updated: true.