Create or Update a Contact

Creates or updates a contact. A new contact only requires either a valid email address or valid mobile phone number. All other fields are optional.

See also the Find or Create a Contact API.

Updating custom fields

DailyStory supports custom fields to allow you to store virtually any data with a contact.

Recommended

While custom fields comes with their own benefits you can add/remove data using API even if you haven't created the custom field.

To update a contact's custom fields, include the custom field data in the JSON body of your POST:

{ "email":"example@example.com", "extendedProperties":{ "some_custom_field":"hello world" } }

While not required, we recommend custom field key is lower case, contain no spaces, and are limited to alphanumeric characters. This ensures that if the custom field were used for API access, such as personalization, the customer field could be accessed. For example, {{profile.some_custom_field}}.  

HTTP Request Examples
Create a contact
{ "email": "rob@example.com", "firstName": "Rob", "lastName": "Howard", "mobilePhone": "+15557140059", "city": "Dallas", "region": "Texas", "extendedProperties": { "stripe_customer_id": "cus_DRvE6c5V9jp", "class_of_license": "Premium" } }
Update an existing contact
{ "dsId": "43aaf5af35f866b1edba7", "firstName": "Rob", "lastName": "Howard", "title": "Founder, CEO" }
HTTP Request Parameters
dsIdstring
The dsid of an existing contact to update. Omit when creating a new contact.
emailstring
Contact email address. Either email or mobilePhone is required when creating a new contact.
mobilePhonestring
Contact mobile number (E.164 format recommended). Either email or mobilePhone is required when creating a new contact.
firstName, lastName, salutation, titlestring
Optional name and title fields.
statusstring
Contact status. One of: Active, Inactive, Spam, Deleted.
country, region, city, postalCode, address, geoCodestring
Optional location fields.
phone, homePhonestring
Additional phone numbers.
company, website, industry, numberOfEmployees, annualRevenuestring/number
Optional company/firmographic fields.
donotcontact, optOutEmail, optOutSms, optOutPush, optOutPhoneboolean
Subscription flags. Setting these opts the contact out of the corresponding channel.
maxContactFrequencyInDaysnumber
Maximum number of days between contacts. Set to 0 to disable.
extendedPropertiesobject
Dictionary of custom field values. Keys should be lowercase with underscores, values are strings. See the Updating custom fields section above.
HTTP Response Examples
200
{ "Status": true, "Message": "", "Response": { "id": "43aaf5af35f866b1edba7" } }
HTTP Response Parameters
idstring
The dsid of the created or updated contact.