Create Patient
curl --request POST \
--url https://api.soharhealth.com/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/1999",
"state": "CA"
}
'import requests
url = "https://api.soharhealth.com/v1/patients"
payload = {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/1999",
"state": "CA"
}
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({firstName: 'John', lastName: 'Doe', dateOfBirth: '01/01/1999', state: 'CA'})
};
fetch('https://api.soharhealth.com/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.soharhealth.com/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([
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '01/01/1999',
'state' => 'CA'
]),
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.soharhealth.com/v1/patients"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\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.soharhealth.com/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/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 \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\n}"
response = http.request(request)
puts response.read_body{
"patientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": "invalid_request_error",
"param": "firstName"
}{
"error": "invalid_request_error"
}Legacy Endpoints
Create Patient
This API is still available but no longer supported and is planned for deprecation in a future release; users should transition to the Create Verifications API.
POST
/
v1
/
patients
Create Patient
curl --request POST \
--url https://api.soharhealth.com/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/1999",
"state": "CA"
}
'import requests
url = "https://api.soharhealth.com/v1/patients"
payload = {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/1999",
"state": "CA"
}
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({firstName: 'John', lastName: 'Doe', dateOfBirth: '01/01/1999', state: 'CA'})
};
fetch('https://api.soharhealth.com/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.soharhealth.com/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([
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '01/01/1999',
'state' => 'CA'
]),
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.soharhealth.com/v1/patients"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\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.soharhealth.com/v1/patients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/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 \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/1999\",\n \"state\": \"CA\"\n}"
response = http.request(request)
puts response.read_body{
"patientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": "invalid_request_error",
"param": "firstName"
}{
"error": "invalid_request_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The patient's first name
Example:
"John"
The patient's last name
Example:
"Doe"
The patient's birth date in MM/DD/YYYY format
Pattern:
^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d\d$Example:
"09/20/2023"
Two-letter US state code
Available options:
AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VA, VT, WA, WI, WV, WY Example:
"CA"
Response
A patient ID
The Sohar ID for the patient
Example:
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
⌘I