Create a patient
curl --request POST \
--url https://api.byblend.com/api/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
}
'import requests
url = "https://api.byblend.com/api/v1/patients"
payload = {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": False,
"is_diabetic": False,
"is_pregnant": False,
"receive_sms": True,
"receive_email": True,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
}
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({
first_name: 'Willard',
last_name: 'Donnelly',
email: 'Harmon43@gmail.com',
phone: '6417383445',
date_of_birth: '1990-01-01',
address: {
address_1: '140 Lindgren Streets',
city: 'North Consueloburgh',
state: 'CA',
zip_code: '02108',
address_2: 'Apt 227',
country: 'US'
},
middle_name: 'Moises',
gender: 'male',
driver_license_number: 'B49188319',
driver_license_state: 'CA',
ssn: '123456789',
primary_language: 'en',
guardian_name: 'John Guardian',
guardian_phone: '6417383445',
guardian_email: 'parent@example.com',
guardian_relationship: 'parent',
height_inches: 72,
weight_pounds: 180,
external_id: '1234567890',
is_smoker: false,
is_diabetic: false,
is_pregnant: false,
receive_sms: true,
receive_email: true,
risk_factors: {
allergies: 'peanuts, tree nuts, shellfish',
conditions: 'asthma, hypertension',
medications: 'albuterol, levothyroxine'
}
})
};
fetch('https://api.byblend.com/api/v1/patients', 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.byblend.com/api/v1/patients",
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([
'first_name' => 'Willard',
'last_name' => 'Donnelly',
'email' => 'Harmon43@gmail.com',
'phone' => '6417383445',
'date_of_birth' => '1990-01-01',
'address' => [
'address_1' => '140 Lindgren Streets',
'city' => 'North Consueloburgh',
'state' => 'CA',
'zip_code' => '02108',
'address_2' => 'Apt 227',
'country' => 'US'
],
'middle_name' => 'Moises',
'gender' => 'male',
'driver_license_number' => 'B49188319',
'driver_license_state' => 'CA',
'ssn' => '123456789',
'primary_language' => 'en',
'guardian_name' => 'John Guardian',
'guardian_phone' => '6417383445',
'guardian_email' => 'parent@example.com',
'guardian_relationship' => 'parent',
'height_inches' => 72,
'weight_pounds' => 180,
'external_id' => '1234567890',
'is_smoker' => false,
'is_diabetic' => false,
'is_pregnant' => false,
'receive_sms' => true,
'receive_email' => true,
'risk_factors' => [
'allergies' => 'peanuts, tree nuts, shellfish',
'conditions' => 'asthma, hypertension',
'medications' => 'albuterol, levothyroxine'
]
]),
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.byblend.com/api/v1/patients"
payload := strings.NewReader("{\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\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.byblend.com/api/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/patients")
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 \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"first_name": "Willard",
"middle_name": "Moises",
"last_name": "Donnelly",
"gender": "male",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"is_minor": false
}Patients
Create a patient
Create a new patient.
Returns 400 with existing_patient_id (and, if populated, existing_patient_external_id) when the create attempt is identified as a duplicate of an active patient.
POST
/
api
/
v1
/
patients
Create a patient
curl --request POST \
--url https://api.byblend.com/api/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
}
'import requests
url = "https://api.byblend.com/api/v1/patients"
payload = {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": False,
"is_diabetic": False,
"is_pregnant": False,
"receive_sms": True,
"receive_email": True,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
}
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({
first_name: 'Willard',
last_name: 'Donnelly',
email: 'Harmon43@gmail.com',
phone: '6417383445',
date_of_birth: '1990-01-01',
address: {
address_1: '140 Lindgren Streets',
city: 'North Consueloburgh',
state: 'CA',
zip_code: '02108',
address_2: 'Apt 227',
country: 'US'
},
middle_name: 'Moises',
gender: 'male',
driver_license_number: 'B49188319',
driver_license_state: 'CA',
ssn: '123456789',
primary_language: 'en',
guardian_name: 'John Guardian',
guardian_phone: '6417383445',
guardian_email: 'parent@example.com',
guardian_relationship: 'parent',
height_inches: 72,
weight_pounds: 180,
external_id: '1234567890',
is_smoker: false,
is_diabetic: false,
is_pregnant: false,
receive_sms: true,
receive_email: true,
risk_factors: {
allergies: 'peanuts, tree nuts, shellfish',
conditions: 'asthma, hypertension',
medications: 'albuterol, levothyroxine'
}
})
};
fetch('https://api.byblend.com/api/v1/patients', 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.byblend.com/api/v1/patients",
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([
'first_name' => 'Willard',
'last_name' => 'Donnelly',
'email' => 'Harmon43@gmail.com',
'phone' => '6417383445',
'date_of_birth' => '1990-01-01',
'address' => [
'address_1' => '140 Lindgren Streets',
'city' => 'North Consueloburgh',
'state' => 'CA',
'zip_code' => '02108',
'address_2' => 'Apt 227',
'country' => 'US'
],
'middle_name' => 'Moises',
'gender' => 'male',
'driver_license_number' => 'B49188319',
'driver_license_state' => 'CA',
'ssn' => '123456789',
'primary_language' => 'en',
'guardian_name' => 'John Guardian',
'guardian_phone' => '6417383445',
'guardian_email' => 'parent@example.com',
'guardian_relationship' => 'parent',
'height_inches' => 72,
'weight_pounds' => 180,
'external_id' => '1234567890',
'is_smoker' => false,
'is_diabetic' => false,
'is_pregnant' => false,
'receive_sms' => true,
'receive_email' => true,
'risk_factors' => [
'allergies' => 'peanuts, tree nuts, shellfish',
'conditions' => 'asthma, hypertension',
'medications' => 'albuterol, levothyroxine'
]
]),
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.byblend.com/api/v1/patients"
payload := strings.NewReader("{\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\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.byblend.com/api/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/patients")
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 \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"first_name": "Willard",
"middle_name": "Moises",
"last_name": "Donnelly",
"gender": "male",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"is_minor": false
}Authorizations
Body
application/json
Response
Patient created successfully