Create a New User
curl --request POST \
--url https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"principal": "<string>",
"roles": [
123
],
"saml_provider_id": "<string>",
"sso_provider_id": {
"int32": 123,
"valid": true
},
"is_disabled": true,
"secret": "<string>",
"needs_password_reset": true
}
'import requests
url = "https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"principal": "<string>",
"roles": [123],
"saml_provider_id": "<string>",
"sso_provider_id": {
"int32": 123,
"valid": True
},
"is_disabled": True,
"secret": "<string>",
"needs_password_reset": True
}
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>',
email_address: 'jsmith@example.com',
principal: '<string>',
roles: [123],
saml_provider_id: '<string>',
sso_provider_id: {int32: 123, valid: true},
is_disabled: true,
secret: '<string>',
needs_password_reset: true
})
};
fetch('https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users', 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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users",
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>',
'email_address' => 'jsmith@example.com',
'principal' => '<string>',
'roles' => [
123
],
'saml_provider_id' => '<string>',
'sso_provider_id' => [
'int32' => 123,
'valid' => true
],
'is_disabled' => true,
'secret' => '<string>',
'needs_password_reset' => true
]),
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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users")
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 \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"saml_provider_id": {
"int32": 123,
"valid": true
},
"sso_provider_id": {
"int32": 123,
"valid": true
},
"AuthSecret": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"digest_method": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"totp_activated": true
},
"roles": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"name": "<string>",
"description": "<string>",
"permissions": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"authority": "<string>",
"name": "<string>"
}
]
}
],
"first_name": {
"string": "<string>",
"valid": true
},
"last_name": {
"string": "<string>",
"valid": true
},
"email_address": {
"string": "<string>",
"valid": true
},
"principal_name": "<string>",
"last_login": "2023-11-07T05:31:56Z",
"is_disabled": true,
"eula_accepted": true
}
}{
"http_status": 400,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "The JSON payload could not be unmarshalled."
}
]
}{
"http_status": 401,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "login",
"message": "Unauthorized"
}
]
}{
"http_status": 403,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "You do not have permission to access this resource"
}
]
}{
"http_status": 429,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "middleware",
"message": "Too many requests. Please try again later."
}
]
}{
"http_status": 500,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "The request could not be handled due to an unexpected database error."
}
]
}BloodHound Users
Create a New User
Create a new BloodHound user.
POST
/
api
/
v2
/
bloodhound-users
Create a New User
curl --request POST \
--url https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"principal": "<string>",
"roles": [
123
],
"saml_provider_id": "<string>",
"sso_provider_id": {
"int32": 123,
"valid": true
},
"is_disabled": true,
"secret": "<string>",
"needs_password_reset": true
}
'import requests
url = "https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email_address": "jsmith@example.com",
"principal": "<string>",
"roles": [123],
"saml_provider_id": "<string>",
"sso_provider_id": {
"int32": 123,
"valid": True
},
"is_disabled": True,
"secret": "<string>",
"needs_password_reset": True
}
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>',
email_address: 'jsmith@example.com',
principal: '<string>',
roles: [123],
saml_provider_id: '<string>',
sso_provider_id: {int32: 123, valid: true},
is_disabled: true,
secret: '<string>',
needs_password_reset: true
})
};
fetch('https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users', 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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users",
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>',
'email_address' => 'jsmith@example.com',
'principal' => '<string>',
'roles' => [
123
],
'saml_provider_id' => '<string>',
'sso_provider_id' => [
'int32' => 123,
'valid' => true
],
'is_disabled' => true,
'secret' => '<string>',
'needs_password_reset' => true
]),
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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\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://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-tenant.bloodhoundenterprise.io/api/v2/bloodhound-users")
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 \"email_address\": \"jsmith@example.com\",\n \"principal\": \"<string>\",\n \"roles\": [\n 123\n ],\n \"saml_provider_id\": \"<string>\",\n \"sso_provider_id\": {\n \"int32\": 123,\n \"valid\": true\n },\n \"is_disabled\": true,\n \"secret\": \"<string>\",\n \"needs_password_reset\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"saml_provider_id": {
"int32": 123,
"valid": true
},
"sso_provider_id": {
"int32": 123,
"valid": true
},
"AuthSecret": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"digest_method": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"totp_activated": true
},
"roles": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"name": "<string>",
"description": "<string>",
"permissions": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": {
"time": "2023-11-07T05:31:56Z",
"valid": true
},
"authority": "<string>",
"name": "<string>"
}
]
}
],
"first_name": {
"string": "<string>",
"valid": true
},
"last_name": {
"string": "<string>",
"valid": true
},
"email_address": {
"string": "<string>",
"valid": true
},
"principal_name": "<string>",
"last_login": "2023-11-07T05:31:56Z",
"is_disabled": true,
"eula_accepted": true
}
}{
"http_status": 400,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "The JSON payload could not be unmarshalled."
}
]
}{
"http_status": 401,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "login",
"message": "Unauthorized"
}
]
}{
"http_status": 403,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "You do not have permission to access this resource"
}
]
}{
"http_status": 429,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "middleware",
"message": "Too many requests. Please try again later."
}
]
}{
"http_status": 500,
"timestamp": "2024-02-19T19:27:43.866Z",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"errors": [
{
"context": "clients",
"message": "The request could not be handled due to an unexpected database error."
}
]
}Authorizations
JWTBearerTokenSignedRequest & RequestDate & HMACSignature
Authorization: Bearer $JWT_TOKEN
Headers
Prefer header, used to specify a custom timeout in seconds using the wait parameter as per RFC7240. Passing in wait=-1 bypasses all timeout limits when the feature is enabled.
Pattern:
^wait=(-1|[0-9]+)$Body
application/json
The request body for creating a user
Deprecated. Use sso_provider_id instead.
ID of the SSO provider for this user
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
⌘I