Create or update a contact
const url = 'https://api.tryletterhead.com/api/v3/contacts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"email":"[email protected]","firstName":"Michael","lastName":"Jones","tags":["amazing-contact","engaged"],"customFields":{"favoriteColor":"blue","lifetimeValue":250},"source":"website-signup"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/contacts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "email": "[email protected]", "firstName": "Michael", "lastName": "Jones", "tags": [ "amazing-contact", "engaged" ], "customFields": { "favoriteColor": "blue", "lifetimeValue": 250 }, "source": "website-signup" }'Creates a company-level contact, or updates the existing contact if one with the same email already exists (an upsert).
- If no contact with the given
emailexists, a new contact is created and the response is201 Created. - If a contact with that
emailalready exists, its profile is updated with the fields in the request body and the response is200 OK. - If a
channelis supplied (see below), an already-existing contact’s profile is not overwritten — the contact is simply subscribed to that channel.
Custom fields
Pass a customFields object to set values on the contact’s custom fields. Each key is the name of a custom field you’ve defined for your company, and the value is coerced to that field’s configured type (text, number, boolean, or date).
{
"email": "[email protected]",
"customFields": {
"favoriteColor": "blue",
"lifetimeValue": 250
}
}
Notes:
- Each key must match a custom field that already exists for your company. Unknown field names are rejected.
- Keys beginning with
__lh.are reserved for Letterhead’s system-managed fields and cannot be set. customFieldsis optional. Omit it to create a contact without setting any custom field values.
Channel subscription
Provide a channel (a channel slug) to subscribe the contact to that channel at creation time. If a company-level contact with the same email already exists, its existing profile is left untouched and the contact is simply subscribed to the channel. Omit channel to create the contact at the company level only.
Source
The optional source records where the contact came from — for example, the name of the integration that created it. It is set once on the contact and is not overwritten by later updates. A create without a source is recorded as a hand-entered manual contact.
Contacts without an email address (early access)
This is in early access: it is rolling out gradually and may not be available on your account yet. Where it isn’t, a request with endpoints and no email is refused with 422 (“An email address is required to create a contact.”).
Instead of email, send endpoints with exactly one entry: the phone number the contact is reached at. The contact is created with that number and identified by it from then on. Use the contactKey in the response to address it on the /api/v3/contacts/keyed/{contactKey} routes, since it has no email address to put in a path.
{
"api": true,
"endpoints": [{ "medium": "sms", "address": "+14155550171" }],
"firstName": "Pat"
}
mediumissms, orwhatsappwhere WhatsApp is enabled for your account. Any other value is refused.addressmust start with+and the country code. Spaces, dots, hyphens and brackets are allowed, and the number is stored in E.164 form. A value that isn’t a valid phone number is refused.- Send
emailorendpoints, not both. A request carrying both is refused with422. For someone you have both for, create the contact withemailand add the phone number afterwards. - More than one entry in
endpointsis refused with422. - If one of your contacts already holds that number, that contact is returned with
200 OKand the request’s other fields are not applied to it. Otherwise the contact is created and the response is201 Created. - When two requests for the same number arrive at once, one of them can get
409 Conflict(“This address was just registered. Please try again.”). Retry it: the retry returns the new contact with200 OK. firstName,lastName,tags,customFieldsandsourceapply as they do withemail.- With a
channel, the contact is subscribed to that channel, withstatusif you send one. If the number already belongs to a contact who has no email address, that contact is subscribed and returned with200 OK, unchanged otherwise. If the number belongs to a contact who has an email address, the request is refused with422(reason:endpointHeldByContactWithEmail) and nothing changes: add that person by their email address instead.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Required. Set to true to authenticate with an API key.
The contact’s email address, matched on for the upsert. Required unless endpoints is sent (early access); send one or the other, not both.
Early access. Instead of email, the one phone number to create the contact with. See Contacts without an email address above.
object
sms, or whatsapp where WhatsApp is enabled for your account.
The phone number, starting with + and the country code. Spaces, dots, hyphens and brackets are allowed.
The contact’s first name.
The contact’s last name.
Tags to apply to the contact.
Values for your company’s custom fields, keyed by field name. See below.
object
Origin label for where the contact came from. Recorded once and never overwritten. Defaults to manual when omitted. See below.
Example
{ "api": true, "firstName": "Michael", "lastName": "Jones", "tags": [ "amazing-contact", "engaged" ], "customFields": { "favoriteColor": "blue", "lifetimeValue": 250 }, "source": "website-signup"}Responses
Section titled “ Responses ”Existing contact updated, or, for a request with endpoints (early access), the contact already holding that number, returned unchanged apart from any channel subscription. Same response shape as 201 below, and as GET /api/v3/contacts/{email}.
object
The updated contact. Full field list under GET /api/v3/contacts/{email}.
object
Example
{ "items": { "firstName": "Michael", "lastName": "Jones" }, "message": "Contact updated.", "total": 1}New contact created
object
The created or updated contact. Full field list under GET /api/v3/contacts/{email}.
object
The contact’s email address. Empty for a contact created from endpoints.
The contact’s opaque 64-character hex key, used to address it on the /api/v3/contacts/keyed/{contactKey} routes.
What the contact was created with, email or a phone number from endpoints (endpoint, early access).
object
object
Example
{ "items": { "firstName": "Michael", "lastName": "Jones", "tags": [ "amazing-contact", "engaged" ], "customFields": { "favoriteColor": "blue", "lifetimeValue": 250 }, "subscriptions": [], "createdAt": "2026-08-30T15:01:21+00:00", "updatedAt": "2026-08-30T15:01:21+00:00" }, "message": "Contact created.", "total": 1}Still can’t find what you need? Contact support.