Modifica un lead
curl --request PATCH \
--url https://api.dentalspace.ai/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"sourceDetail": "<string>",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"lostReason": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
sourceDetail: '<string>',
notes: '<string>',
assignedTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
estimatedValue: 50000000,
nextFollowUpAt: '2023-11-07T05:31:56Z',
lostReason: '<string>'
})
};
fetch('https://api.dentalspace.ai/v1/leads/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/leads/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"sourceDetail": "<string>",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"lostReason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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>",
"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>"
}
}Contatti commerciali
Modifica un lead
Scope: leads:write.
Solo i campi mandati cambiano; null svuota un campo facoltativo. Un cambio di status riparte il conteggio dei giorni nello stadio. Per convertire in paziente usa POST /leads/{id}/convert. Con If-Match la modifica fallisce con 409 se il lead e’ cambiato nel frattempo.
PATCH
/
leads
/
{id}
Modifica un lead
curl --request PATCH \
--url https://api.dentalspace.ai/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"sourceDetail": "<string>",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"lostReason": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
sourceDetail: '<string>',
notes: '<string>',
assignedTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
estimatedValue: 50000000,
nextFollowUpAt: '2023-11-07T05:31:56Z',
lostReason: '<string>'
})
};
fetch('https://api.dentalspace.ai/v1/leads/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/leads/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"sourceDetail": "<string>",
"notes": "<string>",
"assignedTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"estimatedValue": 50000000,
"nextFollowUpAt": "2023-11-07T05:31:56Z",
"lostReason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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>",
"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>"
}
}Authorizations
Headers
Path Parameters
Body
application/json
Pattern:
^(?:(?:\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)))$Response
Il lead aggiornato.