Contacts
Create Contact Creates a new contact. Fails with 409 if a contact with the same email already exists for the host — callers wanting "create or fetch existing" behaviour should use the host management site upsert flow instead.
AuthorizationRequired Bearer <token>
API key as Bearer token
In: header
application/jsonRequired
emailRequired string
Contact email — unique per host, lowercased on persist
Pattern: "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" Format: "email"
POST /v1/contacts/ cURL Go Node.js Python PHP Ruby Java C# curl -X POST "https://api.3common.com/v1/contacts/" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"firstName": "string",
"lastName": "string",
"phone": "string"
}' Default Response 200 400 401 403 409
Response {
"data" : {
"id" : "string" ,
"firstName" : "string" ,
"lastName" : "string" ,
"fullName" : "string" ,
"email" : "string" ,
"phone" : "string" ,
"vendorId" : "string" ,
"orderSum" : 0 ,
"grossSum" : 0 ,
"firstOrder" : 0 ,
"lastOrder" : 0 ,
"createdAt" : "2019-08-24T14:15:22Z" ,
"status" : "unsubscribed" ,
"eventsAttended_IDS" : [
"string"
],
"itemsPurchased_IDS" : [
"string"
],
"productsPurchased_IDS" : [
"string"
],
"property1" : null ,
"property2" : null
}
} TypeScript export interface Response {
data : {
id : string ;
firstName : string ;
lastName : string ;
fullName : string ;
email : string ;
phone ?: string ;
vendorId : string ;
orderSum : number ;
grossSum : number ;
/**
* First order, ms since epoch
*/
firstOrder ?: number ;
/**
* Most recent order, ms since epoch
*/
lastOrder ?: number ;
createdAt ?: string ;
/**
* Subset of statuses surfaced on the compact contact projection.
*/
status : "unsubscribed" | "opted-in" | "unknown" ;
eventsAttended_IDS : string [];
itemsPurchased_IDS : string [];
productsPurchased_IDS : string [];
[ k : string ] : unknown ;
};
}