Create a custom field definition
POST
/api/v3/contacts/custom-fields
const url = 'https://api.tryletterhead.com/api/v3/contacts/custom-fields';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"name":"favoriteColor","label":"Favorite color","type":"text"}'};
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/custom-fields \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "name": "favoriteColor", "label": "Favorite color", "type": "text" }'Creates a company-level custom field. Once created, set its values per contact with customFields on Create or update a contact / Update a contact.
This is a company-level (v3) write. Authenticate with a company API key as a Bearer token.
Authorizations
Section titled βAuthorizations βRequest Body required
Section titled βRequest Body required β Media type application/json
object
api
required
Required. Set to true to authenticate with an API key.
boolean
name
required
The fieldβs key. Letters, numbers, underscores, and spaces only. Max 255 characters.
string
label
required
The human-readable label shown in the UI. Max 255 characters.
string
type
required
text, number, boolean, or date.
string
required
Whether the field must be filled in. Defaults to false.
boolean
sortOrder
Display position. Omit to have one assigned automatically.
integer
Example
{ "api": true, "name": "favoriteColor", "label": "Favorite color", "type": "text"}Responses
Section titled β Responses βCustom field definition created.
Still can’t find what you need? Contact support.