列出工作区成员

get /v1/organizations/workspaces/{workspace_id}/members

列出工作区成员

路径参数

  • workspace_id: string

    工作区的 ID。

查询参数

  • after_id: optional string

    用作分页游标的对象 ID。提供后,返回该对象之后的结果页。

  • before_id: optional string

    用作分页游标的对象 ID。提供后,返回该对象之前的结果页。

  • limit: optional number

    每页返回的项目数。

    默认为 20。范围为 11000

返回值

  • data: array of WorkspaceMember

    • type: "workspace_member"

      对象类型。

      对于工作区成员,始终为 "workspace_member"

      • "workspace_member"
    • user_id: string

      用户的 ID。

    • workspace_id: string

      工作区的 ID。

    • workspace_role: "workspace_user" or "workspace_developer" or "workspace_restricted_developer" or 2 more

      工作区成员的角色。

      • "workspace_user"

      • "workspace_developer"

      • "workspace_restricted_developer"

      • "workspace_admin"

      • "workspace_billing"

  • first_id: string

    data 列表中的第一个 ID。可用作上一页的 before_id

  • has_more: boolean

    指示在请求的页面方向上是否还有更多结果。

  • last_id: string

    data 列表中的最后一个 ID。可用作下一页的 after_id

示例

curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_ADMIN_API_KEY"

响应

{
  "data": [
    {
      "type": "workspace_member",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      "workspace_role": "workspace_user"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}