curl --request PATCH \
--url https://api.bydoctor.com.br/api/public/v1/appointments/{public_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "<string>",
"professional_id": 123,
"room_id": 123,
"start_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}"
payload = {
"note": "<string>",
"professional_id": 123,
"room_id": 123,
"start_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
note: '<string>',
professional_id: 123,
room_id: 123,
start_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}', 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://api.bydoctor.com.br/api/public/v1/appointments/{public_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'note' => '<string>',
'professional_id' => 123,
'room_id' => 123,
'start_at' => '2023-11-07T05:31:56Z'
]),
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://api.bydoctor.com.br/api/public/v1/appointments/{public_id}"
payload := strings.NewReader("{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_type": {
"id": 123,
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modality": "in_person",
"origin": "staff",
"patient": {
"id": 123,
"name": "<string>",
"phone": "<string>"
},
"professional": {
"id": 123,
"name": "<string>",
"specialty": "<string>"
},
"room": {
"id": 123,
"name": "<string>"
},
"start_at": "2023-11-07T05:31:56Z",
"status": "requested",
"updated_at": "2023-11-07T05:31:56Z"
}Alterar um agendamento
Altera apenas os campos enviados. Só agendamentos presenciais com status scheduled ou confirmed podem ser alterados; a partir de confirmed, apenas status pode mudar. Requer o escopo appointments:write. Responde 409 com code appointment_status_locked, appointment_finalized (prontuário já preenchido), appointment_cancelled, appointment_requested (solicitação de paciente, resolvida no aplicativo), modality_unsupported (teleconsulta), slot_blocked, room_required ou appointment_historic_conflict (troca de profissional com prontuário já preenchido).
curl --request PATCH \
--url https://api.bydoctor.com.br/api/public/v1/appointments/{public_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "<string>",
"professional_id": 123,
"room_id": 123,
"start_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}"
payload = {
"note": "<string>",
"professional_id": 123,
"room_id": 123,
"start_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
note: '<string>',
professional_id: 123,
room_id: 123,
start_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}', 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://api.bydoctor.com.br/api/public/v1/appointments/{public_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'note' => '<string>',
'professional_id' => 123,
'room_id' => 123,
'start_at' => '2023-11-07T05:31:56Z'
]),
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://api.bydoctor.com.br/api/public/v1/appointments/{public_id}"
payload := strings.NewReader("{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bydoctor.com.br/api/public/v1/appointments/{public_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"note\": \"<string>\",\n \"professional_id\": 123,\n \"room_id\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_type": {
"id": 123,
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modality": "in_person",
"origin": "staff",
"patient": {
"id": 123,
"name": "<string>",
"phone": "<string>"
},
"professional": {
"id": 123,
"name": "<string>",
"specialty": "<string>"
},
"room": {
"id": 123,
"name": "<string>"
},
"start_at": "2023-11-07T05:31:56Z",
"status": "requested",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Chave de API no formato bd_live_xxxxxxxx.xxxx...
Path Parameters
^[0-9a-fA-F-]{36}$Body
Corpo para alterar um agendamento. Envie apenas os campos que mudam.
Observação interna do agendamento, até 2000 caracteres.
2000professional.id de um profissional ativo da clínica que atende pacientes.
room.id de uma sala ativa. null volta para a sala padrão da grade do profissional.
Novo início, ISO 8601. Sem fuso horário, é lido em America/Sao_Paulo. Os segundos devem ser 00.
scheduled ou confirmed. Os demais status são definidos apenas pelo aplicativo.
scheduled- scheduledconfirmed- confirmed
scheduled, confirmed Response
Tipo de atendimento do agendamento, como "Consulta" ou "Retorno".
Show child attributes
Show child attributes
in_person- Presencialtelehealth- Teleconsulta
in_person, telehealth staff- Equipepatient_booking- Agendamento onlineapi- API pública
staff, patient_booking, api Paciente do agendamento.
Show child attributes
Show child attributes
Profissional responsável pelo atendimento.
Show child attributes
Show child attributes
Sala em que o atendimento acontece, quando a clínica usa salas.
Show child attributes
Show child attributes
One of: requested, scheduled, confirmed, checked_in, completed, no_show, cancelled.
requested, scheduled, confirmed, checked_in, completed, no_show, cancelled