Provision New User (Admin L1 Only)
curl --request POST \
--url https://api.example.com/api/identity/users/new \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"full_name": "Citra Lestari",
"password": "InitialTempPassword123!",
"role_level": 2,
"role_group_ids": [
"grp_finance_analytics"
]
}
'import requests
url = "https://api.example.com/api/identity/users/new"
payload = {
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"full_name": "Citra Lestari",
"password": "InitialTempPassword123!",
"role_level": 2,
"role_group_ids": ["grp_finance_analytics"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: 'citra.lestari',
email: 'citra@telkom.co.id',
full_name: 'Citra Lestari',
password: 'InitialTempPassword123!',
role_level: 2,
role_group_ids: ['grp_finance_analytics']
})
};
fetch('https://api.example.com/api/identity/users/new', 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://api.example.com/api/identity/users/new",
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' => 'citra.lestari',
'email' => 'citra@telkom.co.id',
'full_name' => 'Citra Lestari',
'password' => 'InitialTempPassword123!',
'role_level' => 2,
'role_group_ids' => [
'grp_finance_analytics'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/users/new"
payload := strings.NewReader("{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/users/new")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/users/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "usr_018f3a55-9999",
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"role_level": 2
}{
"detail": {
"code": "unsupported_api_version",
"message": "API-Version header is unsupported.",
"supported_versions": [
"1"
]
}
}{
"detail": "Not authenticated"
}{
"detail": "Access denied: insufficient permissions"
}{
"detail": "Resource not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Users
Provision New User (Admin L1 Only)
Overview
Administrative endpoint to provision a user account with explicit role_level (1=Superadmin, 2=Manager/L2, 3=User/L3) and role group assignments.
Authentication & Headers
- Auth: Bearer Token (L1 Superadmin Only)
- Required Header:
API-Version: 1
Parameters & Request Body
username(string, required): Login username.email(string, required): Corporate email.password(string, required): Initial temporary password.role_level(integer, required): 1 (Superadmin), 2 (L2 Manager), 3 (L3 User).role_group_ids(array of strings, optional): List of group IDs to attach.
POST
/
api
/
identity
/
users
/
new
Provision New User (Admin L1 Only)
curl --request POST \
--url https://api.example.com/api/identity/users/new \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"full_name": "Citra Lestari",
"password": "InitialTempPassword123!",
"role_level": 2,
"role_group_ids": [
"grp_finance_analytics"
]
}
'import requests
url = "https://api.example.com/api/identity/users/new"
payload = {
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"full_name": "Citra Lestari",
"password": "InitialTempPassword123!",
"role_level": 2,
"role_group_ids": ["grp_finance_analytics"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: 'citra.lestari',
email: 'citra@telkom.co.id',
full_name: 'Citra Lestari',
password: 'InitialTempPassword123!',
role_level: 2,
role_group_ids: ['grp_finance_analytics']
})
};
fetch('https://api.example.com/api/identity/users/new', 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://api.example.com/api/identity/users/new",
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' => 'citra.lestari',
'email' => 'citra@telkom.co.id',
'full_name' => 'Citra Lestari',
'password' => 'InitialTempPassword123!',
'role_level' => 2,
'role_group_ids' => [
'grp_finance_analytics'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/users/new"
payload := strings.NewReader("{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/users/new")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/users/new")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"citra.lestari\",\n \"email\": \"citra@telkom.co.id\",\n \"full_name\": \"Citra Lestari\",\n \"password\": \"InitialTempPassword123!\",\n \"role_level\": 2,\n \"role_group_ids\": [\n \"grp_finance_analytics\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "usr_018f3a55-9999",
"username": "citra.lestari",
"email": "citra@telkom.co.id",
"role_level": 2
}{
"detail": {
"code": "unsupported_api_version",
"message": "API-Version header is unsupported.",
"supported_versions": [
"1"
]
}
}{
"detail": "Not authenticated"
}{
"detail": "Access denied: insufficient permissions"
}{
"detail": "Resource not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Response
User created by administrator