set -eu
umask 077
# Path values must be URL-encoded; query string excludes the leading question mark.
url="${HD_BASE_URL:?Set API origin}/v1/users/marketing/waitlist/${HD_QUERY_STRING:+?${HD_QUERY_STRING}}"
printf 'X-Brand-Slug: hi-doctor\nAccept: application/json\n' > "${HD_REQUEST_HEADERS_FILE:?Private header file}"
curl --silent --show-error --max-time 30 --request POST \
--header "@$HD_REQUEST_HEADERS_FILE" \
--dump-header "${HD_HEADERS_FILE:?Private response header file}" \
--output "${HD_RESPONSE_FILE:?Private response file}" \
--write-out '%{http_code}\n%{content_type}\n' \
--header 'Content-Type: application/json' \
--data-binary "@${HD_REQUEST_FILE:?JSON fixture file}" \
"$url"import os, json
from pathlib import Path
from urllib.parse import quote
import requests
os.umask(0o077)
url = os.environ["HD_BASE_URL"].rstrip("/") + '/v1/users/marketing/waitlist/'
if os.environ.get("HD_QUERY_STRING"): url += "?" + os.environ["HD_QUERY_STRING"]
headers = {"X-Brand-Slug": "hi-doctor", "Accept": 'application/json'}
kwargs = {}
kwargs["json"] = json.loads(Path(os.environ["HD_REQUEST_FILE"]).read_text())
response = requests.request('POST', url, headers=headers, timeout=30, allow_redirects=False, **kwargs)
Path(os.environ["HD_RESPONSE_FILE"]).write_bytes(response.content)
Path(os.environ["HD_HEADERS_FILE"]).write_text(json.dumps(dict(response.headers)))
print(response.status_code)
print(response.headers.get("Content-Type", ""))
import { readFileSync, writeFileSync } from "node:fs";
const env = process.env;
let url = env.HD_BASE_URL.replace(/\/$/, "") + "/v1/users/marketing/waitlist/";
if (env.HD_QUERY_STRING) url += "?" + env.HD_QUERY_STRING;
const headers = { "X-Brand-Slug": "hi-doctor", "Accept": "application/json" };
const options = { method: "POST", headers, redirect: "manual", signal: AbortSignal.timeout(30000) };
headers["Content-Type"] = "application/json";
options.body = readFileSync(env.HD_REQUEST_FILE, "utf8");
const response = await fetch(url, options);
writeFileSync(env.HD_RESPONSE_FILE, Buffer.from(await response.arrayBuffer()), {mode: 0o600});
writeFileSync(env.HD_HEADERS_FILE, JSON.stringify(Object.fromEntries(response.headers)), {mode: 0o600});
console.log(response.status);
console.log(response.headers.get("content-type") ?? "");
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hi-doctor.ai/v1/users/marketing/waitlist/",
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' => 'synthetic-patient@example.invalid',
'subject_slug' => 'synthetic',
'subject_display_name' => 'synthetic'
]),
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/marketing/waitlist/"
payload := strings.NewReader("{\n \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\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/marketing/waitlist/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/marketing/waitlist/")
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 \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"id": "00000000-0000-4000-8000-000000000000",
"created": false,
"contactId": null,
"subjectKind": "medicine",
"subjectSegmentId": null,
"medicineSegmentId": null
}{
"ok": true,
"id": "00000000-0000-4000-8000-000000000000",
"created": true,
"contactId": null,
"subjectKind": "medicine",
"subjectSegmentId": null,
"medicineSegmentId": null
}{
"ok": false,
"error": "invalid-waitlist-payload"
}{
"detail": "Request was throttled."
}{
"ok": false,
"error": "resend-not-configured"
}Join a treatment waitlist
Records a patient website waitlist interest and sends a welcome message to the submitted address.
Access, effects and retries
Ownership: Public brand-scoped route; token/recipient scope applies as described.
Prerequisites: Records a patient website waitlist interest and sends a welcome message to the submitted address.
Effects: Records a patient website waitlist interest and sends a welcome message to the submitted address.
Retries: Follow the returned status; do not replay email/provider writes automatically.
set -eu
umask 077
# Path values must be URL-encoded; query string excludes the leading question mark.
url="${HD_BASE_URL:?Set API origin}/v1/users/marketing/waitlist/${HD_QUERY_STRING:+?${HD_QUERY_STRING}}"
printf 'X-Brand-Slug: hi-doctor\nAccept: application/json\n' > "${HD_REQUEST_HEADERS_FILE:?Private header file}"
curl --silent --show-error --max-time 30 --request POST \
--header "@$HD_REQUEST_HEADERS_FILE" \
--dump-header "${HD_HEADERS_FILE:?Private response header file}" \
--output "${HD_RESPONSE_FILE:?Private response file}" \
--write-out '%{http_code}\n%{content_type}\n' \
--header 'Content-Type: application/json' \
--data-binary "@${HD_REQUEST_FILE:?JSON fixture file}" \
"$url"import os, json
from pathlib import Path
from urllib.parse import quote
import requests
os.umask(0o077)
url = os.environ["HD_BASE_URL"].rstrip("/") + '/v1/users/marketing/waitlist/'
if os.environ.get("HD_QUERY_STRING"): url += "?" + os.environ["HD_QUERY_STRING"]
headers = {"X-Brand-Slug": "hi-doctor", "Accept": 'application/json'}
kwargs = {}
kwargs["json"] = json.loads(Path(os.environ["HD_REQUEST_FILE"]).read_text())
response = requests.request('POST', url, headers=headers, timeout=30, allow_redirects=False, **kwargs)
Path(os.environ["HD_RESPONSE_FILE"]).write_bytes(response.content)
Path(os.environ["HD_HEADERS_FILE"]).write_text(json.dumps(dict(response.headers)))
print(response.status_code)
print(response.headers.get("Content-Type", ""))
import { readFileSync, writeFileSync } from "node:fs";
const env = process.env;
let url = env.HD_BASE_URL.replace(/\/$/, "") + "/v1/users/marketing/waitlist/";
if (env.HD_QUERY_STRING) url += "?" + env.HD_QUERY_STRING;
const headers = { "X-Brand-Slug": "hi-doctor", "Accept": "application/json" };
const options = { method: "POST", headers, redirect: "manual", signal: AbortSignal.timeout(30000) };
headers["Content-Type"] = "application/json";
options.body = readFileSync(env.HD_REQUEST_FILE, "utf8");
const response = await fetch(url, options);
writeFileSync(env.HD_RESPONSE_FILE, Buffer.from(await response.arrayBuffer()), {mode: 0o600});
writeFileSync(env.HD_HEADERS_FILE, JSON.stringify(Object.fromEntries(response.headers)), {mode: 0o600});
console.log(response.status);
console.log(response.headers.get("content-type") ?? "");
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hi-doctor.ai/v1/users/marketing/waitlist/",
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' => 'synthetic-patient@example.invalid',
'subject_slug' => 'synthetic',
'subject_display_name' => 'synthetic'
]),
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/marketing/waitlist/"
payload := strings.NewReader("{\n \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\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/marketing/waitlist/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/marketing/waitlist/")
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 \"email\": \"synthetic-patient@example.invalid\",\n \"subject_slug\": \"synthetic\",\n \"subject_display_name\": \"synthetic\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"id": "00000000-0000-4000-8000-000000000000",
"created": false,
"contactId": null,
"subjectKind": "medicine",
"subjectSegmentId": null,
"medicineSegmentId": null
}{
"ok": true,
"id": "00000000-0000-4000-8000-000000000000",
"created": true,
"contactId": null,
"subjectKind": "medicine",
"subjectSegmentId": null,
"medicineSegmentId": null
}{
"ok": false,
"error": "invalid-waitlist-payload"
}{
"detail": "Request was throttled."
}{
"ok": false,
"error": "resend-not-configured"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Brand for this request; use hi-doctor for these examples.
Body
Email address of the patient or recipient, normalized by the endpoint.
Stable medicine or condition slug identifying the waitlist interest.
Subject name shown in the waitlist confirmation email.
Preferred email language; unsupported values fall back to English.
Treatment category associated with the waitlist signup.
Acquisition funnel associated with the waitlist signup.
Acquisition source recorded for the waitlist signup.
City display name recorded for the waitlist signup.
Stable city slug recorded for the waitlist signup.
Country associated with the waitlist signup.
Waitlist subject kind; defaults to medicine.
medicine, condition Response
Successful response.
Whether the request was accepted.
Identifier of the stored waitlist interest.
True for a new interest; false for an updated email and subject.
Provider contact identifier returned by the best-effort upsert.
Normalized subject kind.
medicine, condition Configured waitlist audience identifier for this locale.
Compatibility alias of subjectSegmentId.