> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/api/api-en/back-office-api-reference/system-bo-api/user-organization-management.md).

# User Organization Management

## Save Department List

> \## Function Description\
> \* Registers, modifies, and deletes department list information.\
> \---\
> \## Detailed Description\
> \* Processes the registration, modification, and deletion information received all at once from the grid on the screen.\
> \* A department cannot be deleted if it is set for a specific user.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RealGridCUDRequestUserDeptRequest":{"type":"object","properties":{"all":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptRequest"}},"create":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptRequest"}},"update":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptRequest"}},"delete":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptRequest"}}}},"UserDeptRequest":{"type":"object","description":"User Organization Management Request DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/system/userDeptMgmt/saveUserDeptList":{"post":{"tags":["User Organization Management"],"summary":"Save Department List","description":"## Function Description\n* Registers, modifies, and deletes department list information.\n---\n## Detailed Description\n* Processes the registration, modification, and deletion information received all at once from the grid on the screen.\n* A department cannot be deleted if it is set for a specific user.\n","operationId":"saveUserDeptList","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RealGridCUDRequestUserDeptRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"string"}}}},"900":{"description":"Business processing error details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## Retrieve Sub-Department List

> \## Function Description\
> &#x20; \* Retrieves the list of sub-departments of the department selected on the screen.\
> &#x20; \---\
> &#x20; \## Detailed Description\
> &#x20; \* Retrieves currently stored departments in a hierarchical structure, from the top-level department down to sub-departments.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserDeptRequest":{"type":"object","description":"User Organization Management Request DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]}}},"RealGridListResponseUserDeptResponse":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"payloads":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptResponse"}}}},"UserDeptResponse":{"type":"object","description":"User Organization Management Response DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]},"userId":{"type":"string","description":"User ID Mapped to Department"},"level":{"type":"string","description":"Department Level"},"hierarchy":{"type":"string","description":"Hierarchy Structure"},"hierarchyText":{"type":"string","description":"e.g.) Color Cosmetics > Base Makeup"},"leafYn":{"type":"string","description":"Lowest-Level Status"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v2/system/userDeptMgmt/getUserDeptMgmtList":{"get":{"tags":["User Organization Management"],"summary":"Retrieve Sub-Department List","description":"## Function Description\n  * Retrieves the list of sub-departments of the department selected on the screen.\n  ---\n  ## Detailed Description\n  * Retrieves currently stored departments in a hierarchical structure, from the top-level department down to sub-departments.\n","operationId":"getUserDeptList","parameters":[{"name":"userDeptRequest","in":"query","required":true,"schema":{"$ref":"#/components/schemas/UserDeptRequest"}},{"name":"deptCd","in":"query","description":"Department Code","schema":{"type":"string"}},{"name":"pageIdx","in":"query","description":"Page No.","schema":{"type":"string"}},{"name":"rowsPerPage","in":"query","description":"Items per Page","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RealGridListResponseUserDeptResponse"}}}},"900":{"description":"Business processing error details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## Retrieve Sub-Department List

> \## Function Description\
> &#x20; \* Retrieves the list of sub-departments of the department selected on the screen.\
> &#x20; \---\
> &#x20; \## Detailed Description\
> &#x20; \* Retrieves currently stored departments in a hierarchical structure, from the top-level department down to sub-departments.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserDeptRequest":{"type":"object","description":"User Organization Management Request DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]}}},"UserDeptResponse":{"type":"object","description":"User Organization Management Response DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]},"userId":{"type":"string","description":"User ID Mapped to Department"},"level":{"type":"string","description":"Department Level"},"hierarchy":{"type":"string","description":"Hierarchy Structure"},"hierarchyText":{"type":"string","description":"e.g.) Color Cosmetics > Base Makeup"},"leafYn":{"type":"string","description":"Lowest-Level Status"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/system/userDeptMgmt/getUserDeptList":{"get":{"tags":["User Organization Management"],"summary":"Retrieve Sub-Department List","description":"## Function Description\n  * Retrieves the list of sub-departments of the department selected on the screen.\n  ---\n  ## Detailed Description\n  * Retrieves currently stored departments in a hierarchical structure, from the top-level department down to sub-departments.\n","operationId":"getUserDeptList_1","parameters":[{"name":"userDeptRequest","in":"query","required":true,"schema":{"$ref":"#/components/schemas/UserDeptRequest"}},{"name":"deptCd","in":"query","description":"Department Code","schema":{"type":"string"}},{"name":"pageIdx","in":"query","description":"Page No.","schema":{"type":"string"}},{"name":"rowsPerPage","in":"query","description":"Items per Page","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptResponse"}}}}},"900":{"description":"Business processing error details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## Retrieve Department Hierarchy List

> \## Function Description\
> \* Retrieves the currently stored department list.\
> \---\
> \## Detailed Description\
> \* Retrieves the currently stored departments in a hierarchical structure, from the top-level department down to the sub-departments.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserDeptResponse":{"type":"object","description":"User Organization Management Response DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]},"userId":{"type":"string","description":"User ID Mapped to Department"},"level":{"type":"string","description":"Department Level"},"hierarchy":{"type":"string","description":"Hierarchy Structure"},"hierarchyText":{"type":"string","description":"e.g.) Color Cosmetics > Base Makeup"},"leafYn":{"type":"string","description":"Lowest-Level Status"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/system/userDeptMgmt/getUserDeptListWithHierarchy":{"get":{"tags":["User Organization Management"],"summary":"Retrieve Department Hierarchy List","description":"## Function Description\n* Retrieves the currently stored department list.\n---\n## Detailed Description\n* Retrieves the currently stored departments in a hierarchical structure, from the top-level department down to the sub-departments.\n","operationId":"getUserDeptListWithHierarchy","responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDeptResponse"}}}}},"900":{"description":"Business processing error details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## Retrieve Sub-Department List Count

> &#x20;\## Function Description\
> &#x20; \* Retrieves the sub-department count for the department selected on the screen.\
> &#x20; \---\
> &#x20; \## Detailed Description\
> &#x20; \* Retrieves the sub-department count for the department selected on the screen.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserDeptRequest":{"type":"object","description":"User Organization Management Request DTO","properties":{"deptCd":{"type":"string","description":"Department Code"},"deptNm":{"type":"string","description":"Department Name"},"sortSeq":{"type":"string","description":"Sort Order"},"useYn":{"type":"string","description":"Usage Status"},"uprDeptCd":{"type":"string","description":"Parent Department Code"},"jobGrpCd":{"type":"string","description":"Work Group Code","enum":["SYSTEM_MANAGER","MD","MARKETING","LGST_CNTR","CUST_CNTR","COOP_CORP","AFCR"]}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/system/userDeptMgmt/getUserDeptListCount":{"get":{"tags":["User Organization Management"],"summary":"Retrieve Sub-Department List Count","description":" ## Function Description\n  * Retrieves the sub-department count for the department selected on the screen.\n  ---\n  ## Detailed Description\n  * Retrieves the sub-department count for the department selected on the screen.\n","operationId":"getUserDeptListCount","parameters":[{"name":"userDeptRequest","in":"query","required":true,"schema":{"$ref":"#/components/schemas/UserDeptRequest"}},{"name":"deptCd","in":"query","description":"Department Code","schema":{"type":"String"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"integer","format":"int32"}}}},"900":{"description":"Business processing error details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```
