Create single contact (upsert: updates if email lowercase already exists for winery)
POST
/v2/contacts
const url = 'https://api-crm-staging.divinea.com/api/v2/contacts';const options = { method: 'POST', headers: {APIKey: '<APIKey>', 'Content-Type': 'application/json'}, body: '{"acceptedMarketing":true,"acceptedPrivacyTerms":true,"acceptedProfiling":true,"contactType":"MASTER","countryIso":"IT","email":"john.doe@gmail.com","firstName":"John","lastName":"Doe","manualMarketing":false,"otherData":{},"phoneNumber":"+39 123456789","unsubscribed":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-crm-staging.divinea.com/api/v2/contacts \ --header 'APIKey: <APIKey>' \ --header 'Content-Type: application/json' \ --data '{ "acceptedMarketing": true, "acceptedPrivacyTerms": true, "acceptedProfiling": true, "contactType": "MASTER", "countryIso": "IT", "email": "john.doe@gmail.com", "firstName": "John", "lastName": "Doe", "manualMarketing": false, "otherData": {}, "phoneNumber": "+39 123456789", "unsubscribed": false }'Authorizations
Sezione intitolata “Authorizations”Request Body
Sezione intitolata “Request Body”Contact
Media typeapplication/json
ContactDTOEmail
object
acceptedMarketing
Accepted Marketing
boolean
Example
trueacceptedPrivacyTerms
Accepted Privacy Terms
boolean
Example
trueacceptedProfiling
Accepted Profiling
boolean
Example
truecontactType
required
Contact Type - At least one contact and one MASTER. The other ones can be saved if SECONDARY
string
Example
MASTERcountryIso
required
Country ISO
string
Example
ITemail
required
string
Example
john.doe@gmail.comfirstName
required
First Name
string
Example
JohnlastName
required
Last Name
string
Example
DoemanualMarketing
Privacy Manual flagged by winery (has a signed paper)
boolean
Example
falseotherData
Other data to be safe
object
Example
{}phoneNumber
required
Phone Number
string
Example
+39 123456789unsubscribed
Privacy Unsubscribed
boolean
Example
falseResponses
Sezione intitolata “Responses”OK
Media type*/*
ContactDTOEmail
object
acceptedMarketing
Accepted Marketing
boolean
Example
trueacceptedPrivacyTerms
Accepted Privacy Terms
boolean
Example
trueacceptedProfiling
Accepted Profiling
boolean
Example
truecontactType
required
Contact Type - At least one contact and one MASTER. The other ones can be saved if SECONDARY
string
Example
MASTERcountryIso
required
Country ISO
string
Example
ITemail
required
string
Example
john.doe@gmail.comfirstName
required
First Name
string
Example
JohnlastName
required
Last Name
string
Example
DoemanualMarketing
Privacy Manual flagged by winery (has a signed paper)
boolean
Example
falseotherData
Other data to be safe
object
Example
{}phoneNumber
required
Phone Number
string
Example
+39 123456789unsubscribed
Privacy Unsubscribed
boolean
Example
false