> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trae.cn/llms.txt
> Use this file to discover all available pages before exploring further.

获取指定部门的详细信息。

## 所需权限 {#所需权限}

`departments:read`

## 请求说明 {#请求说明}

* 请求方式：`GET`
* 请求地址：`{域名}/openapi/v1/departments/{id}`

## 注意事项 {#hnIGJ75OM}

本接口不支持使用根别名 `"0"` 来查询根部门的信息。如需获取根部门的信息，需调用 “[批量获取多个部门的信息](/enterprise_batch-get-information-for-multiple-departments)” 接口。

## 请求参数 {#请求参数}

### 请求头参数 {#请求头参数}

<!-- @cols-width: 172,122,596 -->
| **Header 参数**  | **是否必填**  | **描述**  |
| --- | --- | --- |
| `Authorization`  | 是  | 固定取值为 `Bearer {access_token}`。关于如何获取访问令牌，参考[鉴权](enterprise_authentication)。  |

### 查询参数 {#请求参数_1}

<!-- @cols-width: 111,120,131,100,431 -->
| **参数**  | **类型**  | **是否必填**  | **默认值**  | **描述**  |
| --- | --- | --- | --- | --- |
| `id`  | string  | 是  | \-  | 待查询部门的 ID。 | \
| | | | | | \
| | | | | 部门 ID 可以通过 “[获取单个父部门的子部门](/enterprise_get-the-subdepartments-for-a-specified-parent-department)” 接口或 ”[按关键词搜索部门](/enterprise_query-department-by-keyword)“ 接口获取。  |

## 响应参数 {#响应参数}

该接口独有的响应参数如下，参数位于 `data` 中。通用响应参数参考[此文档](/enterprise_general-response-schema)。

<!-- @cols-width: 244,165,476 -->
| **参数**  | **类型**  | **描述**  |
| --- | --- | --- |
| `department_id`  | string  | 该部门的 ID。  |
| `parent_department_id`  | string  | 该部门直属的父部门的 ID。值为 `"0"` 时表示企业根部门。  |
| `name`  | string  | 该部门的名称。  |
| `full_path`  | string  | 该部门的完整归属路径。各级部门名称以 `/` 分隔。  |
| `depth`  | int  | 该部门的层级深度。  |

## 示例 {#示例}

### 请求示例 {#请求示例}

```Bash
curl -X GET "${HOST}/openapi/v1/departments/10001" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
```

### 响应示例 {#响应示例}

```JSON
{
  "code": 0,
  "message": "success",
  "request_id": "req_xxx",
  "data": {
    "department_id": "10001",
    "parent_department_id": "0",
    "name": "研发部",
    "full_path": "公司/研发部",
    "depth": 1,
    "sort_order": 100,
    "ctime": 1780000000,
    "mtime": 1780500000,
    "version": 3
  }
}
```

## 错误码 {#错误码}

若该接口的请求返回错误码，参考[错误码](/enterprise_error-codes)文档进行排查。
