Skip to main content
GET
/
api
/
v2
/
self
Get self
curl --request GET \
  --url https://your-tenant.bloodhoundenterprise.io/api/v2/self
import requests

url = "https://your-tenant.bloodhoundenterprise.io/api/v2/self"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://your-tenant.bloodhoundenterprise.io/api/v2/self', 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/self",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://your-tenant.bloodhoundenterprise.io/api/v2/self"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://your-tenant.bloodhoundenterprise.io/api/v2/self")
.asString();
require 'uri'
require 'net/http'

url = URI("https://your-tenant.bloodhoundenterprise.io/api/v2/self")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

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": 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."
}
]
}
Applies to BloodHound Enterprise and CE

Headers

Prefer
string
default:wait=30

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]+)$

Response

OK

data
object