# 获取工作空间ID
#### 从控制台获取工作空间ID
在调用接口的时候，部分URL中需要填入工作空间ID（workspace_id），工作空间ID获取步骤如下：
1. 登录[AI DataLake管理控制台](https://console.huaweicloud.com/fabric/)。
2. 在左侧导航栏中，单击工作空间区域，在下拉列表中选择"工作空间管理"。
   图1工作空间管理   
   ![](https://support.huaweicloud.com/api-aidatalake/zh-cn_image_0000002749180130.png "点击放大")
   
   
3. 在"工作空间"页面的"空间名称/ID"列中查看工作空间ID。
图2查看工作空间ID   
![](https://support.huaweicloud.com/api-aidatalake/zh-cn_image_0000002749020238.png "点击放大")
#### 调用API获取工作空间ID
工作空间ID可以通过调用[查询工作空间列表](https://support.huaweicloud.com/api-aidatalake/ListV2Workspaces.html)接口获取。
获取工作空间ID的接口为"GET https://{Endpoint}/v2/workspaces"，其中{Endpoint}为IAM的终端节点，具体请参考[终端节点](https://support.huaweicloud.com/api-aidatalake/aidatalake_02_0001.html#aidatalake_02_0001__zh-cn_topic_0264280009_section17316828876)。接口的认证鉴权请参见[认证鉴权](https://support.huaweicloud.com/api-aidatalake/aidatalake_02_0005.html)。
响应示例如下，其中的"id"即为"name"所对应的工作空间ID。
```
{
  "total" : 3,
  "workspaces" : [ {
    "id" : "6ccab7b6-fe3a-xxxx-xxxx-be37323bd254",
    "name" : "AIDataLake-Test-Workspace",
    "description" : "AI DataLake测试工作空间",
    "create_time" : "2026-06-23T12:51:21.000+00:00",
    "create_domain_name" : "test_domain",
    "create_user_name" : "test_user",
    "metastore_id" : "0ba8919e-f52c-xxxx-xxxx-9ad7ecdb5ed9",
    "enterprise_project_id" : "0",
    "tags" : [ {
      "key" : "environment",
      "value" : "test"
    }, {
      "key" : "creator",
      "value" : "postman-script"
    }, {
      "key" : "purpose",
      "value" : "automation-testing"
    } ]
  }, {
    "id" : "61ff9cae-2e9e-xxxx-xxxx-fc4e199c83be",
    "name" : "AIDataLake-pool",
    "description" : "",
    "create_time" : "2026-06-22T08:27:32.000+00:00",
    "create_domain_name" : "test_domain",
    "create_user_name" : "test_user",
    "metastore_id" : "99543e6a-1df6-xxxx-xxxx-1a2f185f0968",
    "enterprise_project_id" : "0",
    "tags" : [ ]
  }, {
    "id" : "e89e105f-3aab-xxxx-xxxx-da1d2512a7a8",
    "name" : "AutoTest",
    "description" : "计费自动化测试使用",
    "create_time" : "2026-05-14T08:53:45.000+00:00",
    "create_domain_name" : "test_domain",
    "create_user_name" : "test_user",
    "metastore_id" : "99543e6a-1df6-xxxx-xxxx-1a2f185f0968",
    "enterprise_project_id" : "0",
    "tags" : [ ]
  } ]
}
```
