Skip to main content

Import LDAP Users Locally

This API imports one or more users from the LDAP directory into the local system, assigning each a role and group permissions.

Endpoint Details

URL/v1/ldap/users-store
MethodPOST
AuthorizationBearer Token

Request Headers

HeaderTypeDescription
Content-TypeStringMust be application/json

Request Body

Use the following format to make a request:

JSON Request
{
"users": [
{
"sam_account_name": "member_aplikasi",
"role_code": "member",
"description": "",
"group": [
{
"group_id": "ecbc611d-7924-42b3-9871-a3e92c8d6be9",
"permission_id": "147035ad-a592-4dbf-96e4-ec7e2e5c7c1d",
"permission_type": "custom"
}
]
}
]
}

Parameters

ParameterTypeDescription
usersArrayList of LDAP users to import
sam_account_nameStringSAM account name of the LDAP user to import
role_codeStringRole assigned to the imported user
descriptionStringOptional description of the imported user
groupArrayList of group assignments for the imported user
group_idUUIDIdentifier of the group the user is assigned to
permission_idUUIDIdentifier of the permission granted to the user within the group
permission_typeStringType of the permission granted to the user

Response

Here is an example response after the request has been successfully processed:

Response
{
"total_requested": 1,
"total_success": 1,
"results": [
{
"sam_account_name": "member_aplikasi",
"mail": "member.aplikasi@example.com",
"success": true,
"message": "User imported successfully",
"user_id": "563c941b-f19f-4768-8285-ff81ad8e6f55"
}
]
}

Field Descriptions

FieldTypeDescription
total_requestedIntegerTotal number of users included in the request
total_successIntegerTotal number of users imported successfully
resultsArrayList of per-user import results
sam_account_nameStringSAM account name of the imported user
mailStringEmail address of the imported user
successBooleanIndicates whether the user was imported successfully
messageStringMessage describing the result of the import
user_idUUIDIdentifier of the created local user

info
  • A valid Bearer Token is required to access this endpoint.
  • Multiple users can be imported in a single request; each entry in results reports the outcome for one user.
  • The role_code must correspond to an existing role, and each group_id and permission_id must reference existing records.
  • A valid LDAP configuration must exist before users can be imported.