Register a new patient
curl --request POST \
--url https://api.hi-doctor.ai/v1/users/register/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Brand-Slug: <x-brand-slug>' \
--data '
{
"email": "patient@example.com",
"password": "a-strong-password",
"first_name": "Alex",
"last_name": "Moreno",
"locale": "en"
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/register/"
payload = {
"email": "patient@example.com",
"password": "a-strong-password",
"first_name": "Alex",
"last_name": "Moreno",
"locale": "en"
}
headers = {
"X-Brand-Slug": "<x-brand-slug>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Brand-Slug': '<x-brand-slug>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'patient@example.com',
password: 'a-strong-password',
first_name: 'Alex',
last_name: 'Moreno',
locale: 'en'
})
};
fetch('https://api.hi-doctor.ai/v1/users/register/', 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/register/",
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([
'email' => 'patient@example.com',
'password' => 'a-strong-password',
'first_name' => 'Alex',
'last_name' => 'Moreno',
'locale' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Brand-Slug: <x-brand-slug>"
],
]);
$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/register/"
payload := strings.NewReader("{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Brand-Slug", "<x-brand-slug>")
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/register/")
.header("X-Brand-Slug", "<x-brand-slug>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/register/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Brand-Slug"] = '<x-brand-slug>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Please verify your email with OTP"
}{
"password": [
"This password is too short."
]
}{
"error": "undeliverable",
"code": "registration_email_undeliverable",
"error_name": "REGISTRATION_EMAIL_UNDELIVERABLE"
}{
"detail": "Too many registration attempts. Please try again later.",
"code": "registration_rate_limited",
"error_name": "REGISTRATION_RATE_LIMITED"
}Account
Register a new patient
Starts a signup and emails a one-time code. Returns 200, not 201 — no account exists yet; the registration is held pending until the code is verified.
Requires the X-Brand-Slug: hi-doctor header. Registering an address that belongs to an active account is refused; only an inactive, unverified signup resumes and is reissued a code. A 406 (REGISTRATION_EMAIL_UNDELIVERABLE) is permanent for that address.
POST
/
v1
/
users
/
register
/
Register a new patient
curl --request POST \
--url https://api.hi-doctor.ai/v1/users/register/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Brand-Slug: <x-brand-slug>' \
--data '
{
"email": "patient@example.com",
"password": "a-strong-password",
"first_name": "Alex",
"last_name": "Moreno",
"locale": "en"
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/register/"
payload = {
"email": "patient@example.com",
"password": "a-strong-password",
"first_name": "Alex",
"last_name": "Moreno",
"locale": "en"
}
headers = {
"X-Brand-Slug": "<x-brand-slug>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Brand-Slug': '<x-brand-slug>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'patient@example.com',
password: 'a-strong-password',
first_name: 'Alex',
last_name: 'Moreno',
locale: 'en'
})
};
fetch('https://api.hi-doctor.ai/v1/users/register/', 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/register/",
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([
'email' => 'patient@example.com',
'password' => 'a-strong-password',
'first_name' => 'Alex',
'last_name' => 'Moreno',
'locale' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Brand-Slug: <x-brand-slug>"
],
]);
$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/register/"
payload := strings.NewReader("{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Brand-Slug", "<x-brand-slug>")
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/register/")
.header("X-Brand-Slug", "<x-brand-slug>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/register/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Brand-Slug"] = '<x-brand-slug>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"patient@example.com\",\n \"password\": \"a-strong-password\",\n \"first_name\": \"Alex\",\n \"last_name\": \"Moreno\",\n \"locale\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Please verify your email with OTP"
}{
"password": [
"This password is too short."
]
}{
"error": "undeliverable",
"code": "registration_email_undeliverable",
"error_name": "REGISTRATION_EMAIL_UNDELIVERABLE"
}{
"detail": "Too many registration attempts. Please try again later.",
"code": "registration_rate_limited",
"error_name": "REGISTRATION_RATE_LIMITED"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Identifies the Hi-Doctor brand. Required; the request is rejected without it.
Available options:
hi-doctor Body
application/json
Response
Success
⌘I