Claude Platform Docs

列出服務帳戶

organization.service_accounts.list(**kwargs) -> PageCursor<ServiceAccount>
GET/v1/organizations/service_accounts

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。

列出呼叫者組織中的服務帳戶。

結果依建立時間排序,最新的在前。請使用 limit 和 next_page 游標進行分頁;設定 include_archived=true 以包含已封存的服務帳戶。

Parameters
include_archived: bool⁠Query parameter

Include archived resources. Defaults to false.

limit: Integer⁠Query parameter

Number of results per page.

minimum1
maximum100
page: String⁠Query parameter

Opaque cursor from a previous response's next_page.

Returns
class ServiceAccount { type: :service_account, id, archived_at, 8 more }

Named non-human identity within the caller's organization.

A service account is a pure identity: name + org. Authorization lives on whatever references it (federation rules).

列出服務帳戶
require "anthropic"

anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")

page = anthropic.organization.service_accounts.list

puts(page)
Returns Examples
Response 200
{
  "data": [
    {
      "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "archived_by_actor_id": "archived_by_actor_id",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by_actor_id": "created_by_actor_id",
      "description": "description",
      "name": "ci-deploy-bot",
      "organization_role": "admin",
      "type": "service_account",
      "updated_at": "2024-10-30T23:58:27.427722Z",
      "updated_by_actor_id": "updated_by_actor_id"
    }
  ],
  "next_page": "next_page"
}