Delete Company
curl --request DELETE \
--url https://api.lemlist.com/api/companies/{companyId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/companies/{companyId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/companies/{companyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/companies/{companyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/companies/{companyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"deletedCompanyId": "cpn_A1B2C3D4E5F6G7H8I"
}
Companies
Delete Company
Deletes a lemlist company. Use force=true to detach attached contacts before deletion.
DELETE
/
companies
/
{companyId}
Delete Company
curl --request DELETE \
--url https://api.lemlist.com/api/companies/{companyId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/companies/{companyId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/companies/{companyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/companies/{companyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/companies/{companyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"deletedCompanyId": "cpn_A1B2C3D4E5F6G7H8I"
}
Removes a lemlist company. Only the lemlist record is deleted — no CRM-side propagation is performed.
By default, the request fails with
400 COMPANY_HAS_CONTACTS if any contact is still attached to the company. Pass ?force=true to detach those contacts (their companyId is unset) before deletion.
Remapping duplicates: typical workflow
This endpoint is the final step of the contact-to-company remapping flow used to resolveUNIQUE_INDEX_ERROR_COMPANY sync failures:
GET /companies?crmSyncStatus=unique_index_error_company— list lemlist companies that fail to sync because another lemlist company already occupies their CRM record. Each result exposescrmSync.errors[].metadata.alreadyExistingCompanyId— the canonical lemlist company already linked to the CRM record.GET /contacts?companyId={duplicateCompanyId}— list contacts attached to the duplicate.POST /contacts/{idOrEmail}withcompanyId: {canonicalCompanyId}— reassign each contact to the canonical lemlist company.DELETE /companies/{duplicateCompanyId}— drop the now-empty duplicate. If step 3 was completed for every contact, the call succeeds withoutforce. Otherwise use?force=trueto detach the remaining contacts as part of the deletion.
There is no soft-delete or undo. Once deleted, the lemlist company record is gone. Contacts detached via
force=true keep all their other data — only their companyId is unset.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The lemlist company ID to delete.
Pattern:
^cpn_[a-zA-Z0-9]+$Query Parameters
When true, detaches contacts attached to this company (unsets their companyId) before deleting it. When omitted or false, the request fails with 400 COMPANY_HAS_CONTACTS if any contact is still attached.
Was this page helpful?