Create a contact
client.contact.create(ContactCreateParams { fields, relationships } body, RequestOptionsoptions?): ContactCreateResponse { id, createdAt, fields, 4 more }
POST/v1/contacts
Creates a new contact record.
After creation, Lightfield automatically enriches the contact in the background.
Supports idempotency via the Idempotency-Key header.
To avoid duplicates, we recommend a find-or-create pattern — use list filtering to check if a record exists before creating.
Required scope: contacts:create
Rate limit category: Write
Parameters
Returns
Create a contact
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const contactCreateResponse = await client.contact.create({ fields: { foo: 'string' } });
console.log(contactCreateResponse.id);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}