Update contact
Changes the name or the properties of a contact, or subscribes and unsubscribes them. It holds in every audience they are in.
opensend.contacts.update(id, input?)opensend contacts updateInput
id goes first, on its own, and the rest in one object. One object that holds id works too.
idstringRequiredThe id of the contact, or their address. Up to 120 characters.
firstNamestringA new first name. Up to 120 characters.
lastNamestringA new last name. Up to 120 characters.
statusstringsubscribedorunsubscribed.One of
subscribedunsubscribedpropertiesRecord<string, string | number | boolean | null>Properties to set, by name.
nullremoves one. The others stay as they are.topicsRecord<string, string | null>Choices to set, by the id of the topic:
opt_inoropt_out.nullgoes back to the default of the topic. The others stay as they are.
Returns
The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.
object"contact"Always
contact.idstringThe id of the contact.
emailstringThe address of the contact. A workspace holds an address once.
firstNamestringThe first name of the contact. Empty when it is not known.
lastNamestringThe last name of the contact. Empty when it is not known.
statusstringsubscribedwhile the contact gets broadcasts,unsubscribedafter they leave.One of
subscribedunsubscribedunsubscribedAtstring | nullWhen the contact unsubscribed, or
null.propertiesRecord<string, string | number | boolean>Values of your own on the contact, by name. Automations can test them, and broadcasts and automations fill
{{name}}slots with them.audienceIdsstring[]The ids of the audiences the contact is in.
topicsRecord<string, string>What the contact chose for a topic, by the id of the topic:
opt_inoropt_out. A topic that is not here follows its own default.createdAtstringWhen the contact was added.