Skip to main content
POST
/
users
Create user
import requests

url = "https://{FUSION HOST}/api/users"

payload = { "username": "new-user-test" }
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/users")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"new-user-test\"\n}")
.asString();
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({username: 'new-user-test'})
};

fetch('https://{FUSION HOST}/api/users', 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/users")

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 \"username\": \"new-user-test\"\n}"

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

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

func main() {

url := "https://{FUSION HOST}/api/users"

payload := strings.NewReader("{\n \"username\": \"new-user-test\"\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/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([
'username' => 'new-user-test'
]),
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/users \
--header 'Content-Type: application/json' \
--data '
{
"username": "new-user-test"
}
'
{
  "id": "be0885f2-9885-4c46-f3ea-8e5d0041c292",
  "username": "1new-user-test",
  "realmName": "native",
  "createdAt": "2025-10-30T21:59:01Z",
  "roleNames": [
    "search",
    "developer"
  ],
  "timezone": "Mountain Time (US & Canada)",
  "permissions": [
    {
      "methods": [
        "PUT",
        "POST",
        "GET"
      ]
    }
  ]
}
{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}

Body

application/json
username
string
required
id
string
realmName
string
default:native
write-only
password
string

Passwords must contain alpha+numeric chars and have a length of 8-20. Additional non-newline chars are allowed.

passwordHash
string
roleNames
string[]
write-only

Indicates which roles are dynamically applied to users in the realm.

timezone
string
Example:

"Pacific Time (US & Canada)"

permissions
object[]
realm
string
roles
string[]

One or more user roles. Use GET /roles to get the list of existing roles.

Response

Created

id
string
Example:

"fe0885f2-8885-4c46-a3ea-8e5d0041c293"

username
string
Example:

"admin"

realmName
string
Example:

"ldap-internal"

createdAt
string<date-time>
Example:

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

updatedAt
string<date-time>
Example:

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

roleNames
string[]

Indicates which roles are dynamically applied to users in the realm.

Example:
["search", "developer"]
timezone
string
Example:

"Pacific Time (US & Canada)"

permissions
object[]