Create patients
curl --request POST \
--url https://{clinic}.{region}.practicehub.io/v3/api/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"note": "<string>",
"custom_reference": "<string>",
"locale": "<string>",
"blocked": true,
"default_location": 123,
"referral_source_id": 123,
"communication_preferences": {
"transactional": {
"push_notification": true
},
"marketing": {
"push_notification": true
}
},
"numbers": [
{
"number": "<string>",
"country_code": "<string>",
"iso2": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
'import requests
url = "https://{clinic}.{region}.practicehub.io/v3/api/patients"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"note": "<string>",
"custom_reference": "<string>",
"locale": "<string>",
"blocked": True,
"default_location": 123,
"referral_source_id": 123,
"communication_preferences": {
"transactional": { "push_notification": True },
"marketing": { "push_notification": True }
},
"numbers": [
{
"number": "<string>",
"country_code": "<string>",
"iso2": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
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: '<string>',
last_name: '<string>',
preferred_name: '<string>',
dob: '2023-12-25',
email: 'jsmith@example.com',
note: '<string>',
custom_reference: '<string>',
locale: '<string>',
blocked: true,
default_location: 123,
referral_source_id: 123,
communication_preferences: {transactional: {push_notification: true}, marketing: {push_notification: true}},
numbers: [{number: '<string>', country_code: '<string>', iso2: '<string>'}],
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postcode: '<string>',
country: '<string>'
},
metadata: {}
})
};
fetch('https://{clinic}.{region}.practicehub.io/v3/api/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://{clinic}.{region}.practicehub.io/v3/api/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' => '<string>',
'last_name' => '<string>',
'preferred_name' => '<string>',
'dob' => '2023-12-25',
'email' => 'jsmith@example.com',
'note' => '<string>',
'custom_reference' => '<string>',
'locale' => '<string>',
'blocked' => true,
'default_location' => 123,
'referral_source_id' => 123,
'communication_preferences' => [
'transactional' => [
'push_notification' => true
],
'marketing' => [
'push_notification' => true
]
],
'numbers' => [
[
'number' => '<string>',
'country_code' => '<string>',
'iso2' => '<string>'
]
],
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postcode' => '<string>',
'country' => '<string>'
],
'metadata' => [
]
]),
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://{clinic}.{region}.practicehub.io/v3/api/patients"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\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://{clinic}.{region}.practicehub.io/v3/api/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{clinic}.{region}.practicehub.io/v3/api/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\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"imported_id": "<string>",
"custom_reference": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"balance": "<string>",
"private_balance": "<string>",
"third_party_balance": "<string>",
"updated": "<string>",
"created": "<string>",
"communication_status": "<string>",
"patient_status": "<string>",
"locale": "<string>",
"referral_source_id": 123,
"note": "<string>",
"default_location": 123,
"firebase_id": "<string>",
"app_signup": "<string>",
"app_last_accessed": "<string>",
"blocked": true,
"communication_preferences": {
"transactional": {
"push_notification": true
},
"marketing": {
"push_notification": true
}
},
"numbers": [
{
"id": 123,
"number": "<string>",
"country_code": "44",
"iso2": "gb",
"intl_number": "+447911123456"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}Patients
Create patients
POST
https://{clinic}.{region}.practicehub.io/v3/api
/
patients
Create patients
curl --request POST \
--url https://{clinic}.{region}.practicehub.io/v3/api/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"note": "<string>",
"custom_reference": "<string>",
"locale": "<string>",
"blocked": true,
"default_location": 123,
"referral_source_id": 123,
"communication_preferences": {
"transactional": {
"push_notification": true
},
"marketing": {
"push_notification": true
}
},
"numbers": [
{
"number": "<string>",
"country_code": "<string>",
"iso2": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
'import requests
url = "https://{clinic}.{region}.practicehub.io/v3/api/patients"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"note": "<string>",
"custom_reference": "<string>",
"locale": "<string>",
"blocked": True,
"default_location": 123,
"referral_source_id": 123,
"communication_preferences": {
"transactional": { "push_notification": True },
"marketing": { "push_notification": True }
},
"numbers": [
{
"number": "<string>",
"country_code": "<string>",
"iso2": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
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: '<string>',
last_name: '<string>',
preferred_name: '<string>',
dob: '2023-12-25',
email: 'jsmith@example.com',
note: '<string>',
custom_reference: '<string>',
locale: '<string>',
blocked: true,
default_location: 123,
referral_source_id: 123,
communication_preferences: {transactional: {push_notification: true}, marketing: {push_notification: true}},
numbers: [{number: '<string>', country_code: '<string>', iso2: '<string>'}],
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postcode: '<string>',
country: '<string>'
},
metadata: {}
})
};
fetch('https://{clinic}.{region}.practicehub.io/v3/api/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://{clinic}.{region}.practicehub.io/v3/api/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' => '<string>',
'last_name' => '<string>',
'preferred_name' => '<string>',
'dob' => '2023-12-25',
'email' => 'jsmith@example.com',
'note' => '<string>',
'custom_reference' => '<string>',
'locale' => '<string>',
'blocked' => true,
'default_location' => 123,
'referral_source_id' => 123,
'communication_preferences' => [
'transactional' => [
'push_notification' => true
],
'marketing' => [
'push_notification' => true
]
],
'numbers' => [
[
'number' => '<string>',
'country_code' => '<string>',
'iso2' => '<string>'
]
],
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postcode' => '<string>',
'country' => '<string>'
],
'metadata' => [
]
]),
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://{clinic}.{region}.practicehub.io/v3/api/patients"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\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://{clinic}.{region}.practicehub.io/v3/api/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{clinic}.{region}.practicehub.io/v3/api/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\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"email\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"custom_reference\": \"<string>\",\n \"locale\": \"<string>\",\n \"blocked\": true,\n \"default_location\": 123,\n \"referral_source_id\": 123,\n \"communication_preferences\": {\n \"transactional\": {\n \"push_notification\": true\n },\n \"marketing\": {\n \"push_notification\": true\n }\n },\n \"numbers\": [\n {\n \"number\": \"<string>\",\n \"country_code\": \"<string>\",\n \"iso2\": \"<string>\"\n }\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"imported_id": "<string>",
"custom_reference": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"dob": "2023-12-25",
"email": "jsmith@example.com",
"balance": "<string>",
"private_balance": "<string>",
"third_party_balance": "<string>",
"updated": "<string>",
"created": "<string>",
"communication_status": "<string>",
"patient_status": "<string>",
"locale": "<string>",
"referral_source_id": 123,
"note": "<string>",
"default_location": 123,
"firebase_id": "<string>",
"app_signup": "<string>",
"app_last_accessed": "<string>",
"blocked": true,
"communication_preferences": {
"transactional": {
"push_notification": true
},
"marketing": {
"push_notification": true
}
},
"numbers": [
{
"id": 123,
"number": "<string>",
"country_code": "44",
"iso2": "gb",
"intl_number": "+447911123456"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>"
},
"metadata": {}
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}Authorizations
API key from Developers → API Keys, sent as Authorization: Bearer .
Headers
Any unique string (≤255 chars). A retry with the same key within 24 hours replays the original response (Idempotent-Replayed: true) instead of creating a second record.
Maximum string length:
255Body
application/json
Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Available options:
male, female, other Maximum string length:
255Maximum string length:
10Available options:
referral_source, patient Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Integrator-owned key/value metadata (max 50 keys). Values are strings (≤500 chars), numbers or booleans and read back with the type they were written with. On write, a null value removes the key. Filter with metadata[key]=op:value; number operands compare numerically.
Show child attributes
Show child attributes
Response
The resource
Show child attributes
Show child attributes
Was this page helpful?
⌘I