Add contact
Adds one person to the workspace, and to the audiences you name. They are subscribed unless you say otherwise. An address that is already a contact is refused: add that contact to an audience instead.
opensend.contacts.create(input)opensend contacts createInput
emailstringRequiredThe address of the contact. A workspace holds an address once. Up to 120 characters.
firstNamestringThe first name, used for
{{first_name}}in broadcasts. Up to 120 characters.lastNamestringThe last name, used for
{{last_name}}in broadcasts. Up to 120 characters.statusstringsubscribedorunsubscribed. Without it the contact is subscribed.One of
subscribedunsubscribedpropertiesRecord<string, string | number | boolean>Values of your own, by name, such as
{ "plan": "pro" }: text, numbers and true or false. Up to 50. Default:{}.audienceIdsstring[]The ids of the audiences to put the contact in. Without it, in none. Up to 50 items. Default:
[].topicsRecord<string, string>What the contact chose for a topic, by the id of the topic:
opt_inoropt_out. A topic left out follows its own default. Default:{}.
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.