Skip to main content
PATCH
Update Values of Custom Variables of a Lead
This is not about renaming your custom variables, but really about updating the values within, just like the Update Lead endpoint would do on default variables.
Default variables follow the Update Lead rules: they are written on the lead’s contact and company as well, and companyName alone renames the company the lead is linked to.The response reports it: warnings carries a company-fields-write-company-record entry naming the company-prefixed keys you sent in params.fields. It is informational, the update went through. To edit a company on purpose, use Upsert Company.
A write that would create a company not yet in lemlist requires the “Create companies” permission on the API key’s user, otherwise it fails with 403 COMPANY_CREATE_NOT_ALLOWED and nothing is written. On a lead with no linked contact, a write that would create one requires the “Create contacts” permission on the API key’s user, otherwise it fails with 403 CONTACT_CREATE_NOT_ALLOWED and nothing is written. The error names that user (The user jane@acme.com does not have the permission to create contacts [CONTACT_CREATE_NOT_ALLOWED]). When the API key’s user is no longer in the team, it fails with 403 API_USER_NOT_IN_TEAM instead (The user jane@acme.com is no longer in this team: ask a current member to create a new API key or reconnect [API_USER_NOT_IN_TEAM]).

Authorizations

Authorization
string
header
required

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

Path Parameters

leadId
string
required

The unique identifier of the lead

Query Parameters

customField1
string

Example custom variable

customField2
string

Example custom variable

customField3
string

Example custom variable

Response

Success

ok
boolean
Example:

true

warnings
object[]

Optional warnings, never a failure — the request went through. They tell you what happened to the company part: written, or skipped and why. See code.