Skip to main content
POST
/
realm-configs
Create a realm
import requests

url = "https://{FUSION HOST}/api/realm-configs"

payload = {
    "realmType": "ldap",
    "name": "dev-ldap3",
    "config": {
        "autoCreateUsers": True,
        "host": "my.fusionhost.com",
        "ssl": True,
        "port": 10636,
        "ephemeralUsers": False,
        "login": { "bindDnTemplate": "uid={},ou=users,dc=security,dc=example,dc=com" }
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.post("https://{FUSION HOST}/api/realm-configs")
.header("Content-Type", "application/json")
.body("{\n \"realmType\": \"ldap\",\n \"name\": \"dev-ldap3\",\n \"config\": {\n \"autoCreateUsers\": true,\n \"host\": \"my.fusionhost.com\",\n \"ssl\": true,\n \"port\": 10636,\n \"ephemeralUsers\": false,\n \"login\": {\n \"bindDnTemplate\": \"uid={},ou=users,dc=security,dc=example,dc=com\"\n }\n }\n}")
.asString();
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
realmType: 'ldap',
name: 'dev-ldap3',
config: {
autoCreateUsers: true,
host: 'my.fusionhost.com',
ssl: true,
port: 10636,
ephemeralUsers: false,
login: {bindDnTemplate: 'uid={},ou=users,dc=security,dc=example,dc=com'}
}
})
};

fetch('https://{FUSION HOST}/api/realm-configs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://{FUSION HOST}/api/realm-configs")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"realmType\": \"ldap\",\n \"name\": \"dev-ldap3\",\n \"config\": {\n \"autoCreateUsers\": true,\n \"host\": \"my.fusionhost.com\",\n \"ssl\": true,\n \"port\": 10636,\n \"ephemeralUsers\": false,\n \"login\": {\n \"bindDnTemplate\": \"uid={},ou=users,dc=security,dc=example,dc=com\"\n }\n }\n}"

response = http.request(request)
puts response.read_body
package main

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

func main() {

url := "https://{FUSION HOST}/api/realm-configs"

payload := strings.NewReader("{\n \"realmType\": \"ldap\",\n \"name\": \"dev-ldap3\",\n \"config\": {\n \"autoCreateUsers\": true,\n \"host\": \"my.fusionhost.com\",\n \"ssl\": true,\n \"port\": 10636,\n \"ephemeralUsers\": false,\n \"login\": {\n \"bindDnTemplate\": \"uid={},ou=users,dc=security,dc=example,dc=com\"\n }\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

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))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/realm-configs",
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([
'realmType' => 'ldap',
'name' => 'dev-ldap3',
'config' => [
'autoCreateUsers' => true,
'host' => 'my.fusionhost.com',
'ssl' => true,
'port' => 10636,
'ephemeralUsers' => false,
'login' => [
'bindDnTemplate' => 'uid={},ou=users,dc=security,dc=example,dc=com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

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

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request POST \
--url https://{FUSION HOST}/api/realm-configs \
--header 'Content-Type: application/json' \
--data '
{
"realmType": "ldap",
"name": "dev-ldap3",
"config": {
"autoCreateUsers": true,
"host": "my.fusionhost.com",
"ssl": true,
"port": 10636,
"ephemeralUsers": false,
"login": {
"bindDnTemplate": "uid={},ou=users,dc=security,dc=example,dc=com"
}
}
}
'
{
  "realmType": "ldap",
  "id": "ef32cba0-5340-4d73-b869-9f4faca45e10",
  "name": "dev-ldap3",
  "enabled": true,
  "createdAt": "2025-10-31T17:06:33Z",
  "config": {
    "autoCreateUsers": true,
    "host": "my.fusionhost.com",
    "ssl": true,
    "port": 10636,
    "ephemeralUsers": false,
    "login": {
      "bindDnTemplate": "uid={},ou=users,dc=security,dc=example,dc=com"
    }
  },
  "roleNames": [
    "developer",
    "admin"
  ]
}
{
"name": "<string>",
"realmType": "native",
"id": "<string>",
"enabled": true,
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z"
}

Body

application/json
name
string
required

The name of the realm. This name will appear on the login screen of the UI, and will appear in user records to identify the realm they belong to.

realmType
string
required

Use the /realm-configs endpoint to get the list of valid realm types.

Example:

"native"

id
string
enabled
boolean

If true, the realm is available for users to use with system authentication.

createdAt
string<date-time>
Example:

"2025-09-23T17:48:07Z"

updatedAt
string<date-time>
Example:

"2025-10-31T12:28:04Z"

Response

Created

name
string
required

The name of the realm. This name will appear on the login screen of the UI, and will appear in user records to identify the realm they belong to.

realmType
string
required

Use the /realm-configs endpoint to get the list of valid realm types.

Example:

"native"

id
string
enabled
boolean

If true, the realm is available for users to use with system authentication.

createdAt
string<date-time>
Example:

"2025-09-23T17:48:07Z"

updatedAt
string<date-time>
Example:

"2025-10-31T12:28:04Z"