Set your goal
curl --request PUT \
--url https://api.hi-doctor.ai/v1/users/journal/goal/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/journal/goal/"
payload = {
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_weight_kg: 74, starting_weight_kg: 86, target_date: '2026-10-19'})
};
fetch('https://api.hi-doctor.ai/v1/users/journal/goal/', 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/journal/goal/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_weight_kg' => 74,
'starting_weight_kg' => 86,
'target_date' => '2026-10-19'
]),
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/journal/goal/"
payload := strings.NewReader("{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hi-doctor.ai/v1/users/journal/goal/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/journal/goal/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000007",
"created_at": "2026-08-02T06:57:53.527161Z",
"updated_at": "2026-08-02T11:43:49.840573Z",
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}{
"weight_kg": [
"A valid number is required."
]
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}Progress
Set your goal
Full replace of the singleton goal. Read it first and merge, or omitted fields are cleared.
PUT
/
v1
/
users
/
journal
/
goal
/
Set your goal
curl --request PUT \
--url https://api.hi-doctor.ai/v1/users/journal/goal/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/journal/goal/"
payload = {
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_weight_kg: 74, starting_weight_kg: 86, target_date: '2026-10-19'})
};
fetch('https://api.hi-doctor.ai/v1/users/journal/goal/', 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/journal/goal/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_weight_kg' => 74,
'starting_weight_kg' => 86,
'target_date' => '2026-10-19'
]),
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/journal/goal/"
payload := strings.NewReader("{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hi-doctor.ai/v1/users/journal/goal/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/journal/goal/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_weight_kg\": 74,\n \"starting_weight_kg\": 86,\n \"target_date\": \"2026-10-19\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0a1b2c3d-4e5f-4a6b-8c9d-000000000007",
"created_at": "2026-08-02T06:57:53.527161Z",
"updated_at": "2026-08-02T11:43:49.840573Z",
"target_weight_kg": 74,
"starting_weight_kg": 86,
"target_date": "2026-10-19"
}{
"weight_kg": [
"A valid number is required."
]
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I