Crea un lead
curl --request POST \
--url https://api.dentalspace.ai/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "other",
"sourceDetail": "<string>",
"status": "new",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
source: 'other',
sourceDetail: '<string>',
status: 'new',
notes: '<string>',
assignedTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
estimatedValue: 50000000,
nextFollowUpAt: '2023-11-07T05:31:56Z',
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.dentalspace.ai/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/leads"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "other",
"sourceDetail": "<string>",
"status": "new",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"source": "social_media",
"sourceDetail": "<string>",
"status": "new",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 123,
"notes": "<string>",
"nextFollowUpAt": "<string>",
"lastContactedAt": "<string>",
"lostReason": "<string>",
"convertedPatientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"convertedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deduplicated": true,
"activities": [
{
"id": "<string>",
"kind": "call",
"body": "<string>",
"at": "<string>"
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Contatti commerciali
Crea un lead
Scope: leads:write.
Se esiste gia’ un lead con lo stesso telefono (qualunque formato: si confronta quello normalizzato) o la stessa email, NON ne crea un altro: risponde 200 con quello esistente e deduplicated: true, senza modificarlo. Una chiamata da un numero sconosciuto e’ un lead con source: "phone". Una chiave limitata a delle sedi deve indicare facilityId.
POST
/
leads
Crea un lead
curl --request POST \
--url https://api.dentalspace.ai/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "other",
"sourceDetail": "<string>",
"status": "new",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
source: 'other',
sourceDetail: '<string>',
status: 'new',
notes: '<string>',
assignedTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
estimatedValue: 50000000,
nextFollowUpAt: '2023-11-07T05:31:56Z',
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.dentalspace.ai/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/leads"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "other",
"sourceDetail": "<string>",
"status": "new",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"source": "social_media",
"sourceDetail": "<string>",
"status": "new",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 123,
"notes": "<string>",
"nextFollowUpAt": "<string>",
"lastContactedAt": "<string>",
"lostReason": "<string>",
"convertedPatientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"convertedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deduplicated": true,
"activities": [
{
"id": "<string>",
"kind": "call",
"body": "<string>",
"at": "<string>"
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Facoltativa. La stessa chiave entro 24 ore ripete la prima risposta 2xx.
Maximum string length:
255Body
application/json
Required string length:
1 - 100Maximum string length:
100Maximum string length:
254Pattern:
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Required string length:
3 - 40Available options:
social_media, website, referral_link, manual, import, phone, walk_in, other, whatsapp Maximum string length:
200Available options:
new, contacted, qualified, proposal, won, lost Maximum string length:
5000Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Required range:
0 <= x <= 100000000Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Response
Il lead creato (201) o quello gia' esistente (200).
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Available options:
social_media, website, referral_link, manual, import, phone, walk_in, other, whatsapp Available options:
new, contacted, qualified, proposal, won, lost Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$true = c'era gia': nessun lead creato, nessuna modifica.
Solo nel dettaglio.
Show child attributes
Show child attributes