Update a contact
client.contact.update(stringid, ContactUpdateParams { fields, relationships } body, RequestOptionsoptions?): ContactUpdateResponse { id, createdAt, fields, 4 more }
POST/v1/contacts/{id}
Updates an existing contact by ID. Only included fields and relationships are modified.
Supports idempotency via the Idempotency-Key header.
Required scope: contacts:update
Rate limit category: Write
Parameters
id: string
Unique identifier of the contact to update.
Returns
Update a contact
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const contactUpdateResponse = await client.contact.update('id');
console.log(contactUpdateResponse.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"
}