列出工作区
get /v1/organizations/workspaces
列出工作区
查询参数
-
after_id: optional string用作分页游标的对象 ID。提供时,返回该对象之后的结果页。
-
before_id: optional string用作分页游标的对象 ID。提供时,返回该对象之前的结果页。
-
include_archived: optional boolean是否在响应中包含已归档的工作区。
-
limit: optional number每页返回的项目数量。
默认为
20。范围从1到1000。
返回值
-
data: array of Workspace-
id: string工作区的 ID。
-
archived_at: stringRFC 3339 格式的日期时间字符串,表示工作区被归档的时间。如果工作区未被归档,则为
null。 -
created_at: stringRFC 3339 格式的日期时间字符串,表示工作区的创建时间。
-
data_residency: object { allowed_inference_geos, default_inference_geo, workspace_geo }数据驻留配置。
-
allowed_inference_geos: array of string or "unrestricted"允许的推理地理位置值。'unrestricted' 表示允许所有地理位置。
-
array of string -
"unrestricted""unrestricted"
-
-
default_inference_geo: string当请求省略该参数时应用的默认推理地理位置。
-
workspace_geo: string工作区数据存储的地理区域。创建后不可更改。
-
-
display_color: string在 Anthropic 控制台中代表该工作区的十六进制颜色代码。
-
name: string工作区的名称。
-
tags: map[string]用户自定义的字符串键值对标签。键不能以
anthropic开头。 -
type: "workspace"对象类型。
对于工作区,始终为
"workspace"。"workspace"
-
-
first_id: stringdata列表中的第一个 ID。可用作上一页的before_id。 -
has_more: boolean指示在请求的分页方向上是否还有更多结果。
-
last_id: stringdata列表中的最后一个 ID。可用作下一页的after_id。
示例
curl https://api.anthropic.com/v1/organizations/workspaces \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_ADMIN_API_KEY"
响应
{
"data": [
{
"id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"archived_at": "2024-11-01T23:59:27.427722Z",
"created_at": "2024-10-30T23:58:27.427722Z",
"data_residency": {
"allowed_inference_geos": "unrestricted",
"default_inference_geo": "default_inference_geo",
"workspace_geo": "workspace_geo"
},
"display_color": "#6C5BB9",
"name": "Workspace Name",
"tags": {
"env": "prod",
"team": "platform"
},
"type": "workspace"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}