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 |
| Method | POST |
| Authorization | Bearer Token |
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must 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
| Parameter | Type | Description |
|---|---|---|
| users | Array | List of LDAP users to import |
| sam_account_name | String | SAM account name of the LDAP user to import |
| role_code | String | Role assigned to the imported user |
| description | String | Optional description of the imported user |
| group | Array | List of group assignments for the imported user |
| group_id | UUID | Identifier of the group the user is assigned to |
| permission_id | UUID | Identifier of the permission granted to the user within the group |
| permission_type | String | Type 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
| Field | Type | Description |
|---|---|---|
| total_requested | Integer | Total number of users included in the request |
| total_success | Integer | Total number of users imported successfully |
| results | Array | List of per-user import results |
| sam_account_name | String | SAM account name of the imported user |
| String | Email address of the imported user | |
| success | Boolean | Indicates whether the user was imported successfully |
| message | String | Message describing the result of the import |
| user_id | UUID | Identifier 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
resultsreports the outcome for one user. - The
role_codemust correspond to an existing role, and eachgroup_idandpermission_idmust reference existing records. - A valid LDAP configuration must exist before users can be imported.