Skip to main content
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/admin-account/jwt \
  --header 'Content-Type: application/json' \
  --data '{"email":"admin@company.com","password":"SecureP@ss1"}'
const response = await fetch('https://api.usedatabrain.com/api/v2/admin-account/jwt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'admin@company.com',
    password: 'SecureP@ss1'
  })
});
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/jwt"
headers = {"Content-Type": "application/json"}
payload = {
    "email": "admin@company.com",
    "password": "SecureP@ss1"
}

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 credentials",
    "message": "Invalid credentials"
  }
}
{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "No User found with the given email"
  }
}
{
  "error": {
    "code": "SELFHOSTED_APP_ERROR",
    "message": "This feature is only available for self-hosted instances"
  }
}
POST
/
api
/
v2
/
admin-account
/
jwt
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/admin-account/jwt \
  --header 'Content-Type: application/json' \
  --data '{"email":"admin@company.com","password":"SecureP@ss1"}'
const response = await fetch('https://api.usedatabrain.com/api/v2/admin-account/jwt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'admin@company.com',
    password: 'SecureP@ss1'
  })
});
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/jwt"
headers = {"Content-Type": "application/json"}
payload = {
    "email": "admin@company.com",
    "password": "SecureP@ss1"
}

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 credentials",
    "message": "Invalid credentials"
  }
}
{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "No User found with the given email"
  }
}
{
  "error": {
    "code": "SELFHOSTED_APP_ERROR",
    "message": "This feature is only available for self-hosted instances"
  }
}
Sign in with an existing admin email and password to receive a JWT access token. Use this token in the Authorization header when calling admin-only endpoints such as Create Service Token, Rotate Service Token, and Reset Admin Password.
Self-Hosted Only: This endpoint is available only on self-hosted Databrain instances.

Headers

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

Request Body

email
string
required
Admin user’s email address. Must be a valid email with at least two domain segments.
password
string
required
Admin user’s password.

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. Use as Authorization: Bearer <accessToken> for admin and service-token APIs.
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 – Access token returned in data.accessToken
400Bad Request – Invalid credentials or validation error
500Internal Server Error – Server error or self-hosted-only error

Possible Errors

CodeMessageHTTP Status
USER_NOT_FOUNDNo User found with the given email400
Invalid credentialsInvalid credentials (when password is incorrect or login fails)400
SELFHOSTED_APP_ERRORThis feature is only available for self-hosted instances500
INTERNAL SERVER ERRORConnection Failure500