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

# Get the list of admins

> Call this API to query the list of administrators in an enterprise.

Call this API to query the list of admins.

## API call description

This API is not restricted by the Contacts permission scope.

## Request

| **Basic information** |                                                                                                |
| --------------------- | ---------------------------------------------------------------------------------------------- |
| HTTP URL              | [https://api.dingtalk.io/topapi/user/listadmin](https://api.dingtalk.io/topapi/user/listadmin) |
| HTTP Method           | POST                                                                                           |
| Supported app types   | appType-Internal appappType-Third-party enterprise app                                         |
| Required permissions  | permission-qyapi\_get\_member-Read permission for user information                             |

### Query parameters

| Name          | Type   | Required | Example  | Description                                                                                                                                                                                                                                                             |
| ------------- | ------ | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| access\_token | String | Yes      | bE74xxxx | The App credential used to call this API.   - For an Internal app, obtain it through the API for getting the access\_token of an Internal app. - For a Third-party enterprise app, obtain it through the API for getting the access\_token of a third-party enterprise. |

### Request example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/user/listadmin" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=ba1dfdcc-8a86-4b95-bcb8-af2f9f91ae12'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/listadmin");
OapiUserListadminRequest req = new OapiUserListadminRequest();
OapiUserListadminResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiUserListadminRequest("https://api.dingtalk.io/topapi/user/listadmin")
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiUserListadminRequest;
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/user/listadmin");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/listadmin");
OapiUserListadminRequest req = new OapiUserListadminRequest();
OapiUserListadminResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response body

| Name        | Type                 | Example      | Description                                               |
| ----------- | -------------------- | ------------ | --------------------------------------------------------- |
| request\_id | String               | 4f9md9obopn2 | The request ID.                                           |
| errcode     | Number               | 0            | The return code.                                          |
| errmsg      | String               | ok           | The description of the return code.                       |
| result      | ListAdminResponse\[] |              | The returned result.                                      |
| userid      | String               | 203xxxx1     | The userid of the admin.                                  |
| sys\_level  | Number               | 1            | The admin role:   - **1**: Super Admin - **2**: Sub Admin |

### Response body example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": [
    {
      "sys_level": 2,
      "userid": "203xxxx1"
    },
    {
      "sys_level": 1,
      "userid": "mxxxxx0"
    }
  ],
  "request_id": "4f9md9obopn2"
}
```

### Error codes

If an error occurs when you call this API, find the solution in the [Global error codes](/open/development/server-api-error-codes-1) document based on the error message.

| Error code (errcode) | Error message (errmsg) | Solution                                                              |
| -------------------- | ---------------------- | --------------------------------------------------------------------- |
| 43007                | Authorization required | Check whether the access\_token has permission to perform the action. |
| -1                   | System busy            | Try again later.                                                      |
