Skip to main content
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/admin-account \
  --header 'Content-Type: application/json' \
  --data '{
    "firstName": "Admin",
    "email": "admin@company.com",
    "password": "SecureP@ss1",
    "companyName": "My Company"
  }'
const response = await fetch('https://api.usedatabrain.com/api/v2/admin-account', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    firstName: 'Admin',
    email: 'admin@company.com',
    password: 'SecureP@ss1',
    companyName: 'My Company'
  })
});
const data = await response.json();
if (data.error) throw new Error(data.error.message);
const accessToken = data.data.accessToken;
import requests

url = "https://api.usedatabrain.com/api/v2/admin-account"
headers = {"Content-Type": "application/json"}
payload = {
    "firstName": "Admin",
    "email": "admin@company.com",
    "password": "SecureP@ss1",
    "companyName": "My Company"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()
if data.get("error"):
    raise Exception(data["error"].get("message", "Request failed"))
access_token = data["data"]["accessToken"]
{
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}
{
  "error": {
    "code": "INVALID REQUEST BODY",
    "message": "\"firstName\" is required"
  }
}
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Your company account is already created, please sign in"
  }
}
{
  "error": {
    "code": "SELFHOSTED_APP_ERROR",
    "message": "This feature is only available for self-hosted instances"
  }
}
POST
/
api
/
v2
/
admin-account
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/admin-account \
  --header 'Content-Type: application/json' \
  --data '{
    "firstName": "Admin",
    "email": "admin@company.com",
    "password": "SecureP@ss1",
    "companyName": "My Company"
  }'
const response = await fetch('https://api.usedatabrain.com/api/v2/admin-account', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    firstName: 'Admin',
    email: 'admin@company.com',
    password: 'SecureP@ss1',
    companyName: 'My Company'
  })
});
const data = await response.json();
if (data.error) throw new Error(data.error.message);
const accessToken = data.data.accessToken;
import requests

url = "https://api.usedatabrain.com/api/v2/admin-account"
headers = {"Content-Type": "application/json"}
payload = {
    "firstName": "Admin",
    "email": "admin@company.com",
    "password": "SecureP@ss1",
    "companyName": "My Company"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()
if data.get("error"):
    raise Exception(data["error"].get("message", "Request failed"))
access_token = data["data"]["accessToken"]
{
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}
{
  "error": {
    "code": "INVALID REQUEST BODY",
    "message": "\"firstName\" is required"
  }
}
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Your company account is already created, please sign in"
  }
}
{
  "error": {
    "code": "SELFHOSTED_APP_ERROR",
    "message": "This feature is only available for self-hosted instances"
  }
}
Create the initial admin user and company for a self-hosted deployment. On success, the API returns an access token that can be used for subsequent admin operations (e.g. creating a service token, managing Data Apps). Only one company can exist on a self-hosted instance; if an account already exists, sign in via Create Admin JWT instead.
Self-Hosted Only: This endpoint is available only on self-hosted Databrain instances. Calling it on cloud will return an error.

Headers

Content-Type
string
required
Must be application/json when sending a JSON body.
Content-Type: application/json

Request Body

firstName
string
required
Admin user’s first name. Must be between 3 and 30 characters.
email
string
required
Admin user’s email address. Must be a valid email with at least two domain segments (e.g. user@example.com). Some common consumer email domains may be blocked (e.g. gmail, yahoo, outlook).
password
string
required
Password for the admin account. Must meet:
  • Minimum 8 characters
  • At least 1 uppercase letter
  • At least 1 lowercase letter
  • At least 1 digit
  • At least 1 special character
  • No spaces
companyName
string
required
Name of the company/organization to create for this admin.

Response

On success, the API returns 200 with a JSON object:
data
object
Wrapper object for the response payload.
data.accessToken
string
JWT access token for the newly created admin. Use this in the Authorization: Bearer <accessToken> header for admin APIs (e.g. Create Service Token, Reset Admin Password).
On error, the API returns a JSON object with error.code and error.message and an appropriate HTTP status (400 or 500).

Examples

HTTP Status Code Summary

Status CodeDescription
200OK – Admin account created; data.accessToken returned
400Bad Request – Validation error (invalid email, weak password, missing fields) or company already exists
500Internal Server Error – Server error or self-hosted-only error

Possible Errors

CodeMessageHTTP Status
INVALID REQUEST BODYJoi validation message (e.g. "firstName" is required, "password" should contain at least 1 uppercase character)400
INVALID_REQUESTYour company account is already created, please sign in400
SELFHOSTED_APP_ERRORThis feature is only available for self-hosted instances500
INTERNAL_SERVER_ERRORINTERNAL_SERVER_ERROR500