Create a patient
curl --request POST \
--url https://vitarelay.com/api/public/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_patient_id": "clinic-patient-001",
"first_name": "Jane",
"last_name": "Smith",
"dob": "1985-04-12",
"gender": "female",
"email": "jane.smith@example.com",
"phone": "+18135550100",
"address": {
"line1": "22 Wellness Ave",
"city": "Tampa",
"state": "FL",
"postal_code": "33602"
},
"allergies": [
"penicillin"
],
"current_medications": [
"metformin"
]
}
'import requests
url = "https://vitarelay.com/api/public/v1/patients"
payload = {
"external_patient_id": "clinic-patient-001",
"first_name": "Jane",
"last_name": "Smith",
"dob": "1985-04-12",
"gender": "female",
"email": "jane.smith@example.com",
"phone": "+18135550100",
"address": {
"line1": "22 Wellness Ave",
"city": "Tampa",
"state": "FL",
"postal_code": "33602"
},
"allergies": ["penicillin"],
"current_medications": ["metformin"]
}
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({
external_patient_id: 'clinic-patient-001',
first_name: 'Jane',
last_name: 'Smith',
dob: '1985-04-12',
gender: 'female',
email: 'jane.smith@example.com',
phone: '+18135550100',
address: {line1: '22 Wellness Ave', city: 'Tampa', state: 'FL', postal_code: '33602'},
allergies: ['penicillin'],
current_medications: ['metformin']
})
};
fetch('https://vitarelay.com/api/public/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://vitarelay.com/api/public/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([
'external_patient_id' => 'clinic-patient-001',
'first_name' => 'Jane',
'last_name' => 'Smith',
'dob' => '1985-04-12',
'gender' => 'female',
'email' => 'jane.smith@example.com',
'phone' => '+18135550100',
'address' => [
'line1' => '22 Wellness Ave',
'city' => 'Tampa',
'state' => 'FL',
'postal_code' => '33602'
],
'allergies' => [
'penicillin'
],
'current_medications' => [
'metformin'
]
]),
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://vitarelay.com/api/public/v1/patients"
payload := strings.NewReader("{\n \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\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://vitarelay.com/api/public/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/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 \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sandbox_pat_9f2c41d6",
"external_patient_id": "clinic-patient-001"
}
}{
"data": {
"id": "sandbox_pat_9f2c41d6",
"external_patient_id": "clinic-patient-001"
},
"sandbox": true
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}Patients
Create a patient
Vita Clinic only. Requires the patients:write scope and a key whose
organization is an active Vita Clinic.
The server assigns the clinical home organization and branding owner —
these cannot be set from the request body. Supplying
external_patient_id makes the call idempotent.
POST
/
patients
Create a patient
curl --request POST \
--url https://vitarelay.com/api/public/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_patient_id": "clinic-patient-001",
"first_name": "Jane",
"last_name": "Smith",
"dob": "1985-04-12",
"gender": "female",
"email": "jane.smith@example.com",
"phone": "+18135550100",
"address": {
"line1": "22 Wellness Ave",
"city": "Tampa",
"state": "FL",
"postal_code": "33602"
},
"allergies": [
"penicillin"
],
"current_medications": [
"metformin"
]
}
'import requests
url = "https://vitarelay.com/api/public/v1/patients"
payload = {
"external_patient_id": "clinic-patient-001",
"first_name": "Jane",
"last_name": "Smith",
"dob": "1985-04-12",
"gender": "female",
"email": "jane.smith@example.com",
"phone": "+18135550100",
"address": {
"line1": "22 Wellness Ave",
"city": "Tampa",
"state": "FL",
"postal_code": "33602"
},
"allergies": ["penicillin"],
"current_medications": ["metformin"]
}
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({
external_patient_id: 'clinic-patient-001',
first_name: 'Jane',
last_name: 'Smith',
dob: '1985-04-12',
gender: 'female',
email: 'jane.smith@example.com',
phone: '+18135550100',
address: {line1: '22 Wellness Ave', city: 'Tampa', state: 'FL', postal_code: '33602'},
allergies: ['penicillin'],
current_medications: ['metformin']
})
};
fetch('https://vitarelay.com/api/public/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://vitarelay.com/api/public/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([
'external_patient_id' => 'clinic-patient-001',
'first_name' => 'Jane',
'last_name' => 'Smith',
'dob' => '1985-04-12',
'gender' => 'female',
'email' => 'jane.smith@example.com',
'phone' => '+18135550100',
'address' => [
'line1' => '22 Wellness Ave',
'city' => 'Tampa',
'state' => 'FL',
'postal_code' => '33602'
],
'allergies' => [
'penicillin'
],
'current_medications' => [
'metformin'
]
]),
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://vitarelay.com/api/public/v1/patients"
payload := strings.NewReader("{\n \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\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://vitarelay.com/api/public/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/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 \"external_patient_id\": \"clinic-patient-001\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"dob\": \"1985-04-12\",\n \"gender\": \"female\",\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"+18135550100\",\n \"address\": {\n \"line1\": \"22 Wellness Ave\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"postal_code\": \"33602\"\n },\n \"allergies\": [\n \"penicillin\"\n ],\n \"current_medications\": [\n \"metformin\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sandbox_pat_9f2c41d6",
"external_patient_id": "clinic-patient-001"
}
}{
"data": {
"id": "sandbox_pat_9f2c41d6",
"external_patient_id": "clinic-patient-001"
},
"sandbox": true
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}Authorizations
API key issued by VitaRelay. Send as Authorization: Bearer vr_live_…
(production) or Authorization: Bearer vr_test_… (sandbox).
Body
application/json
ISO date, YYYY-MM-DD.
Your identifier for this patient. Acts as an idempotency key.
Show child attributes
Show child attributes
Response
Idempotent replay — a patient with this external_patient_id
already exists. The original resource is returned.
Show child attributes
Show child attributes
Example:
{ "id": "sandbox_pat_9f2c41d6", "external_patient_id": "clinic-patient-001" }

