curl --request POST \
--url https://api.dev.purplelabelmd.com/v1/account/question-library/questions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"copy": {},
"fact": "<string>",
"option_labels": {},
"options": [
"<string>"
],
"required": true
}
'import requests
url = "https://api.dev.purplelabelmd.com/v1/account/question-library/questions"
payload = {
"copy": {},
"fact": "<string>",
"option_labels": {},
"options": ["<string>"],
"required": True
}
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({
copy: {},
fact: '<string>',
option_labels: {},
options: ['<string>'],
required: true
})
};
fetch('https://api.dev.purplelabelmd.com/v1/account/question-library/questions', 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.dev.purplelabelmd.com/v1/account/question-library/questions",
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([
'copy' => [
],
'fact' => '<string>',
'option_labels' => [
],
'options' => [
'<string>'
],
'required' => true
]),
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.dev.purplelabelmd.com/v1/account/question-library/questions"
payload := strings.NewReader("{\n \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\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.dev.purplelabelmd.com/v1/account/question-library/questions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.purplelabelmd.com/v1/account/question-library/questions")
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 \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"control": "single_select_cards",
"fact": "<string>",
"id": "<string>",
"copy": {},
"option_labels": {},
"options": [
"<string>"
],
"required": true,
"when": {
"kind": "compare"
}
},
"warnings": [
{
"code": "DUPLICATE_FACT",
"fact": "<string>",
"message": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}Create a qualification library question
Creates a reusable screening question for your brand. The question must bind a fact from the authoring catalog; a request that names no such fact, or a fact that asks for medical information, is rejected with a plain-language message. Binding a shared fact is what lets a patient answer the same question only once across screening and the medical intake.
curl --request POST \
--url https://api.dev.purplelabelmd.com/v1/account/question-library/questions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"copy": {},
"fact": "<string>",
"option_labels": {},
"options": [
"<string>"
],
"required": true
}
'import requests
url = "https://api.dev.purplelabelmd.com/v1/account/question-library/questions"
payload = {
"copy": {},
"fact": "<string>",
"option_labels": {},
"options": ["<string>"],
"required": True
}
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({
copy: {},
fact: '<string>',
option_labels: {},
options: ['<string>'],
required: true
})
};
fetch('https://api.dev.purplelabelmd.com/v1/account/question-library/questions', 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.dev.purplelabelmd.com/v1/account/question-library/questions",
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([
'copy' => [
],
'fact' => '<string>',
'option_labels' => [
],
'options' => [
'<string>'
],
'required' => true
]),
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.dev.purplelabelmd.com/v1/account/question-library/questions"
payload := strings.NewReader("{\n \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\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.dev.purplelabelmd.com/v1/account/question-library/questions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.purplelabelmd.com/v1/account/question-library/questions")
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 \"copy\": {},\n \"fact\": \"<string>\",\n \"option_labels\": {},\n \"options\": [\n \"<string>\"\n ],\n \"required\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"control": "single_select_cards",
"fact": "<string>",
"id": "<string>",
"copy": {},
"option_labels": {},
"options": [
"<string>"
],
"required": true,
"when": {
"kind": "compare"
}
},
"warnings": [
{
"code": "DUPLICATE_FACT",
"fact": "<string>",
"message": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}Authorizations
Per-client API key (M2M). Presented as Authorization: Bearer <key>.
Body
create body for a qualification question — the question fields, FLAT (no wrapper object). Your brand comes from your API key, and the platform derives the therapy context from the offering itself, so the body carries neither. The question id is server-minted; a client-sent id is ignored.
single_select_cards, multi_select_cards, scale, number, number_pair, date, text, long_text, file_capture, address, phone, email, search_select your display copy — the question wording rides the prompt slot (required)
Show child attributes
Show child attributes
the stable code of the catalog fact this question collects (must resolve)
your per-option labels, keyed by stable option code (labels never bind logic)
Show child attributes
Show child attributes
stable option codes offered as answers — a subset of the bound fact's own codes
an optional condition — show this question only when an earlier screening answer calls for it. See the same field on the question shape for the full rules.
Show child attributes
Show child attributes
Response
the created library question
the saved question under data, plus non-blocking duplicate notices when another question already collects the same fact (the write still succeeds — warnings never block)
A client-authored screening question — a library definition or an offering-local copy. It binds a fact by its stable code (the code must resolve in your authoring fact catalog) and a display control, and carries your own wording. Copy and option labels are yours to author.
Show child attributes
Show child attributes
Show child attributes
Show child attributes