curl --request POST \
--url https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"changed": false,
"answers": [
{
"question_key": "glp1RenewalAdverseEffects",
"values": {
"pancreatitis": 0,
"severeGi": 0,
"hydration": 0,
"gallbladder": 0
}
}
]
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/"
payload = {
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"changed": False,
"answers": [
{
"question_key": "glp1RenewalAdverseEffects",
"values": {
"pancreatitis": 0,
"severeGi": 0,
"hydration": 0,
"gallbladder": 0
}
}
]
}
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({
consultation_id: '0a1b2c3d-4e5f-4a6b-8c9d-000000000002',
changed: false,
answers: [
{
question_key: 'glp1RenewalAdverseEffects',
values: {pancreatitis: 0, severeGi: 0, hydration: 0, gallbladder: 0}
}
]
})
};
fetch('https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/', 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.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/",
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([
'consultation_id' => '0a1b2c3d-4e5f-4a6b-8c9d-000000000002',
'changed' => false,
'answers' => [
[
'question_key' => 'glp1RenewalAdverseEffects',
'values' => [
'pancreatitis' => 0,
'severeGi' => 0,
'hydration' => 0,
'gallbladder' => 0
]
]
]
]),
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.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/"
payload := strings.NewReader("{\n \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\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://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/")
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 \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"patient_choice_status": "confirmed",
"treatment_id": "wegovy",
"dosage": "0.5 mg",
"dose_change": null,
"treatment_change": null,
"renewal_screen_completed": true
}{
"code": "renewal_answers_required",
"missing_keys": [
"glp1RenewalAdverseEffects"
]
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}{}{
"code": "patient_choice_not_pending",
"patient_choice_status": "confirmed"
}Confirm a pending renewal choice
Records the patient’s decision for one pending renewal. treatment_id and dosage carry the chosen treatment (they may differ from the current one, in which case the doctor reviews the change). changed does not gate the dose/treatment choice: it declares that something in the patient’s clinical situation changed, which requires the broader questionnaire-review answers (answers) in addition to the renewal safety screen; an optional change_note explains it. Clinical eligibility is enforced and the renewal proceeds toward the doctor’s review.
404 if the consultation is not the caller’s; 409 (patient_choice_not_pending) if it was already decided; 400 for a missing or ineligible answer, or a treatment variant that is not in the catalogue.
curl --request POST \
--url https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"changed": false,
"answers": [
{
"question_key": "glp1RenewalAdverseEffects",
"values": {
"pancreatitis": 0,
"severeGi": 0,
"hydration": 0,
"gallbladder": 0
}
}
]
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/"
payload = {
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"changed": False,
"answers": [
{
"question_key": "glp1RenewalAdverseEffects",
"values": {
"pancreatitis": 0,
"severeGi": 0,
"hydration": 0,
"gallbladder": 0
}
}
]
}
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({
consultation_id: '0a1b2c3d-4e5f-4a6b-8c9d-000000000002',
changed: false,
answers: [
{
question_key: 'glp1RenewalAdverseEffects',
values: {pancreatitis: 0, severeGi: 0, hydration: 0, gallbladder: 0}
}
]
})
};
fetch('https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/', 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.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/",
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([
'consultation_id' => '0a1b2c3d-4e5f-4a6b-8c9d-000000000002',
'changed' => false,
'answers' => [
[
'question_key' => 'glp1RenewalAdverseEffects',
'values' => [
'pancreatitis' => 0,
'severeGi' => 0,
'hydration' => 0,
'gallbladder' => 0
]
]
]
]),
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.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/"
payload := strings.NewReader("{\n \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\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://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/subscriptions/pending-choice/confirm/")
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 \"consultation_id\": \"0a1b2c3d-4e5f-4a6b-8c9d-000000000002\",\n \"changed\": false,\n \"answers\": [\n {\n \"question_key\": \"glp1RenewalAdverseEffects\",\n \"values\": {\n \"pancreatitis\": 0,\n \"severeGi\": 0,\n \"hydration\": 0,\n \"gallbladder\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"consultation_id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000002",
"patient_choice_status": "confirmed",
"treatment_id": "wegovy",
"dosage": "0.5 mg",
"dose_change": null,
"treatment_change": null,
"renewal_screen_completed": true
}{
"code": "renewal_answers_required",
"missing_keys": [
"glp1RenewalAdverseEffects"
]
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}{}{
"code": "patient_choice_not_pending",
"patient_choice_status": "confirmed"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.