Appointment
Schedule appointment
This endpoint will schedule the appointment for patient on both TeamCare and Practice PMS.
- Ai Agent will just have to hit on schedule end point as above to schedule the appointment.
- Organization id in url will be the id for practice in teamcare database..
- There are 2 cases we can find the patient or we not, If we found the patient already in Teamcare database it means we have to just send its id in patient_id and not patient_request_attributes, but if we not found the patient the patient id should be nil and patient_request_attributes should come with patient all information.
- Response
- Content-Type: application/json
- Data attribute returned just to give you insights, it has nothing to do with patient.
POST
/
organizations
/
{organization_id}
/
appointments
/
schedule
Schedule appointment
curl --request POST \
--url https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appointment": {
"patient_id": "9lIv6K04",
"appointment_type_id": 2,
"appointment_at": "2028-07-11T09:00:00Z"
}
}
'import requests
url = "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule"
payload = { "appointment": {
"patient_id": "9lIv6K04",
"appointment_type_id": 2,
"appointment_at": "2028-07-11T09:00:00Z"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
appointment: {
patient_id: '9lIv6K04',
appointment_type_id: 2,
appointment_at: '2028-07-11T09:00:00Z'
}
})
};
fetch('https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appointment' => [
'patient_id' => '9lIv6K04',
'appointment_type_id' => 2,
'appointment_at' => '2028-07-11T09:00:00Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule"
payload := strings.NewReader("{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}"
response = http.request(request)
puts response.read_body{}{
"errors": "not authorized"
}{
"errors": "access Denied"
}{
"error": "Appointment not found"
}{
"errors": "..."
}⌘I
Schedule appointment
curl --request POST \
--url https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appointment": {
"patient_id": "9lIv6K04",
"appointment_type_id": 2,
"appointment_at": "2028-07-11T09:00:00Z"
}
}
'import requests
url = "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule"
payload = { "appointment": {
"patient_id": "9lIv6K04",
"appointment_type_id": 2,
"appointment_at": "2028-07-11T09:00:00Z"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
appointment: {
patient_id: '9lIv6K04',
appointment_type_id: 2,
appointment_at: '2028-07-11T09:00:00Z'
}
})
};
fetch('https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appointment' => [
'patient_id' => '9lIv6K04',
'appointment_type_id' => 2,
'appointment_at' => '2028-07-11T09:00:00Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule"
payload := strings.NewReader("{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teamcaredental.com/api/v1/ai_voice/organizations/{organization_id}/appointments/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"appointment\": {\n \"patient_id\": \"9lIv6K04\",\n \"appointment_type_id\": 2,\n \"appointment_at\": \"2028-07-11T09:00:00Z\"\n }\n}"
response = http.request(request)
puts response.read_body{}{
"errors": "not authorized"
}{
"errors": "access Denied"
}{
"error": "Appointment not found"
}{
"errors": "..."
}
