Create a new user record
curl --request POST \
--url http://localhost:3000/v1/user \
--header 'Content-Type: application/json' \
--header 'X-Bunker-Token: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"phone": "<string>",
"login": "<string>",
"firstName": "<string>",
"first": "<string>",
"lastName": "<string>",
"last": "<string>"
}
'import requests
url = "http://localhost:3000/v1/user"
payload = {
"email": "jsmith@example.com",
"phone": "<string>",
"login": "<string>",
"firstName": "<string>",
"first": "<string>",
"lastName": "<string>",
"last": "<string>"
}
headers = {
"X-Bunker-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Bunker-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
phone: '<string>',
login: '<string>',
firstName: '<string>',
first: '<string>',
lastName: '<string>',
last: '<string>'
})
};
fetch('http://localhost:3000/v1/user', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/user",
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([
'email' => 'jsmith@example.com',
'phone' => '<string>',
'login' => '<string>',
'firstName' => '<string>',
'first' => '<string>',
'lastName' => '<string>',
'last' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Bunker-Token: <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 := "http://localhost:3000/v1/user"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Bunker-Token", "<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("http://localhost:3000/v1/user")
.header("X-Bunker-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/user")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Bunker-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"token": "db80789b-0ad7-0690-035a-fd2c42531e87"
}{
"status": "error",
"message": "user with this email already exists"
}{
"status": "error",
"message": "missing X-Bunker-Token header"
}{
"status": "error",
"message": "<string>"
}User
Create a new user record
Creates a new encrypted user record. Databunker extracts login, phone, and email from the request
and builds hashed indexes for lookup. These values must be unique across all users.
POST
/
v1
/
user
Create a new user record
curl --request POST \
--url http://localhost:3000/v1/user \
--header 'Content-Type: application/json' \
--header 'X-Bunker-Token: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"phone": "<string>",
"login": "<string>",
"firstName": "<string>",
"first": "<string>",
"lastName": "<string>",
"last": "<string>"
}
'import requests
url = "http://localhost:3000/v1/user"
payload = {
"email": "jsmith@example.com",
"phone": "<string>",
"login": "<string>",
"firstName": "<string>",
"first": "<string>",
"lastName": "<string>",
"last": "<string>"
}
headers = {
"X-Bunker-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Bunker-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
phone: '<string>',
login: '<string>',
firstName: '<string>',
first: '<string>',
lastName: '<string>',
last: '<string>'
})
};
fetch('http://localhost:3000/v1/user', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/user",
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([
'email' => 'jsmith@example.com',
'phone' => '<string>',
'login' => '<string>',
'firstName' => '<string>',
'first' => '<string>',
'lastName' => '<string>',
'last' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Bunker-Token: <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 := "http://localhost:3000/v1/user"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Bunker-Token", "<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("http://localhost:3000/v1/user")
.header("X-Bunker-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/user")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Bunker-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"login\": \"<string>\",\n \"firstName\": \"<string>\",\n \"first\": \"<string>\",\n \"lastName\": \"<string>\",\n \"last\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"token": "db80789b-0ad7-0690-035a-fd2c42531e87"
}{
"status": "error",
"message": "user with this email already exists"
}{
"status": "error",
"message": "missing X-Bunker-Token header"
}{
"status": "error",
"message": "<string>"
}Authorizations
Root access token for Databunker API
Body
application/jsonapplication/x-www-form-urlencoded
User data can contain any additional fields. The email, phone, and login fields are extracted and indexed for lookup. At least one indexed field is recommended.
User email (unique, creates search index)
User phone number (unique, creates search index)
User login name (unique, creates search index)
User first name
Alternative field for first name
User last name
Alternative field for last name
⌘I