Crea un paziente
curl --request POST \
--url https://api.dentalspace.ai/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"dateOfBirth": "2023-12-25",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allergies": [
"<string>"
],
"medications": [
"<string>"
],
"conditions": [
"<string>"
],
"notes": "<string>"
}
'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>',
dateOfBirth: '2023-12-25',
taxCode: '<string>',
address: {street: '<string>', city: '<string>', zip: '<string>', country: '<string>'},
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allergies: ['<string>'],
medications: ['<string>'],
conditions: ['<string>'],
notes: '<string>'
})
};
fetch('https://api.dentalspace.ai/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/patients"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"dateOfBirth": "2023-12-25",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allergies": ["<string>"],
"medications": ["<string>"],
"conditions": ["<string>"],
"notes": "<string>"
}
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",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"dateOfBirth": "<string>",
"gender": "<string>",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referralSource": "<string>",
"isActive": true,
"archivedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"allergies": [
"<string>"
],
"medications": [
"<string>"
],
"conditions": [
"<string>"
],
"notes": "<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>"
}
}Pazienti
Crea un paziente
Scope: patients:write.
409 conflict (details.patientId) se esiste gia’ un paziente con lo stesso nome e la stessa email o lo stesso telefono. Allergie, farmaci, condizioni e note richiedono anche clinical:write. Con Idempotency-Key un nuovo tentativo non crea un secondo paziente.
POST
/
patients
Crea un paziente
curl --request POST \
--url https://api.dentalspace.ai/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"dateOfBirth": "2023-12-25",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allergies": [
"<string>"
],
"medications": [
"<string>"
],
"conditions": [
"<string>"
],
"notes": "<string>"
}
'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>',
dateOfBirth: '2023-12-25',
taxCode: '<string>',
address: {street: '<string>', city: '<string>', zip: '<string>', country: '<string>'},
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allergies: ['<string>'],
medications: ['<string>'],
conditions: ['<string>'],
notes: '<string>'
})
};
fetch('https://api.dentalspace.ai/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/patients"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"dateOfBirth": "2023-12-25",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allergies": ["<string>"],
"medications": ["<string>"],
"conditions": ["<string>"],
"notes": "<string>"
}
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",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"dateOfBirth": "<string>",
"gender": "<string>",
"taxCode": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>"
},
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referralSource": "<string>",
"isActive": true,
"archivedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"allergies": [
"<string>"
],
"medications": [
"<string>"
],
"conditions": [
"<string>"
],
"notes": "<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
Headers
Body
application/json
Response
Il paziente creato (header ETag).