curl --request POST \
--url https://api.baselayer.com/people \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"ssn": "123456789",
"middle_name": "Michael",
"phone_number": "+14013059855",
"email": "john.doe@example.com",
"date_of_birth": "1990-01-15",
"gender": "M",
"marital_status": "married",
"suffix": "Jr.",
"title": "Mr."
}
'import requests
url = "https://api.baselayer.com/people"
payload = {
"first_name": "John",
"last_name": "Doe",
"ssn": "123456789",
"middle_name": "Michael",
"phone_number": "+14013059855",
"email": "john.doe@example.com",
"date_of_birth": "1990-01-15",
"gender": "M",
"marital_status": "married",
"suffix": "Jr.",
"title": "Mr."
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
ssn: '123456789',
middle_name: 'Michael',
phone_number: '+14013059855',
email: 'john.doe@example.com',
date_of_birth: '1990-01-15',
gender: 'M',
marital_status: 'married',
suffix: 'Jr.',
title: 'Mr.'
})
};
fetch('https://api.baselayer.com/people', 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.baselayer.com/people",
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' => 'John',
'last_name' => 'Doe',
'ssn' => '123456789',
'middle_name' => 'Michael',
'phone_number' => '+14013059855',
'email' => 'john.doe@example.com',
'date_of_birth' => '1990-01-15',
'gender' => 'M',
'marital_status' => 'married',
'suffix' => 'Jr.',
'title' => 'Mr.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.baselayer.com/people"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.baselayer.com/people")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/people")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c2fe09a9-2e5c-4254-9b54-2ea3b376a4f7",
"first_name": "John",
"last_name": "Doe",
"ssn": "XXXXX1234",
"created_at": "2025-01-15T12:00:00Z",
"middle_name": "Michael",
"suffix": "Jr.",
"title": "Mr.",
"updated_at": "2025-01-15T12:00:00Z"
}{
"code": 1000,
"message": "Failed to create person due to validation errors.",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Person
Creates a new person record in the database.
curl --request POST \
--url https://api.baselayer.com/people \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"ssn": "123456789",
"middle_name": "Michael",
"phone_number": "+14013059855",
"email": "john.doe@example.com",
"date_of_birth": "1990-01-15",
"gender": "M",
"marital_status": "married",
"suffix": "Jr.",
"title": "Mr."
}
'import requests
url = "https://api.baselayer.com/people"
payload = {
"first_name": "John",
"last_name": "Doe",
"ssn": "123456789",
"middle_name": "Michael",
"phone_number": "+14013059855",
"email": "john.doe@example.com",
"date_of_birth": "1990-01-15",
"gender": "M",
"marital_status": "married",
"suffix": "Jr.",
"title": "Mr."
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
ssn: '123456789',
middle_name: 'Michael',
phone_number: '+14013059855',
email: 'john.doe@example.com',
date_of_birth: '1990-01-15',
gender: 'M',
marital_status: 'married',
suffix: 'Jr.',
title: 'Mr.'
})
};
fetch('https://api.baselayer.com/people', 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.baselayer.com/people",
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' => 'John',
'last_name' => 'Doe',
'ssn' => '123456789',
'middle_name' => 'Michael',
'phone_number' => '+14013059855',
'email' => 'john.doe@example.com',
'date_of_birth' => '1990-01-15',
'gender' => 'M',
'marital_status' => 'married',
'suffix' => 'Jr.',
'title' => 'Mr.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.baselayer.com/people"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.baselayer.com/people")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/people")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"ssn\": \"123456789\",\n \"middle_name\": \"Michael\",\n \"phone_number\": \"+14013059855\",\n \"email\": \"john.doe@example.com\",\n \"date_of_birth\": \"1990-01-15\",\n \"gender\": \"M\",\n \"marital_status\": \"married\",\n \"suffix\": \"Jr.\",\n \"title\": \"Mr.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c2fe09a9-2e5c-4254-9b54-2ea3b376a4f7",
"first_name": "John",
"last_name": "Doe",
"ssn": "XXXXX1234",
"created_at": "2025-01-15T12:00:00Z",
"middle_name": "Michael",
"suffix": "Jr.",
"title": "Mr.",
"updated_at": "2025-01-15T12:00:00Z"
}{
"code": 1000,
"message": "Failed to create person due to validation errors.",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
The first name of the person
2 - 255"John"
"Jane"
The last name of the person
2 - 255"Doe"
"Smith"
The full social security number of the person
9"123456789"
The middle name of the person
1 - 255"Michael"
The phone number of the person. Area code is mandatory.
12 - 30^\+(?:[1-9]\d{0,2})(?:[ -]?\d{1,4}){1,4}(?:\s?(?:x|ext\.?)\s?\d{1,10})?$"+14013059855"
The email address of the person
5 - 255^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"john.doe@example.com"
The date of birth of the person
"1990-01-15"
The gender of the person
M, F "M"
The marital status of the person
married, single, divorced, widowed, separated, domestic_partner, civil_union, other "married"
The suffix of the person
"Jr."
The title of the person
"Mr."
Response
Person created successfully.
The unique identifier of the person
"c2fe09a9-2e5c-4254-9b54-2ea3b376a4f7"
The first name of the person
"John"
"Jane"
The last name of the person
"Doe"
"Smith"
The social security number of the person
"XXXXX1234"
When the person record was created
"2025-01-15T12:00:00Z"
The middle name of the person
"Michael"
The suffix of the person
"Jr."
The title of the person
"Mr."
When the person record was last updated
"2025-01-15T12:00:00Z"