Claude Platform Docs

Рабочие пространства

Список рабочих пространств
client.Organization.Workspaces.List(ctx, query) (*Page[Workspace], error)
GET/v1/organizations/workspaces
Создать рабочее пространство
client.Organization.Workspaces.New(ctx, body) (*Workspace, error)
POST/v1/organizations/workspaces
Получить рабочее пространство
client.Organization.Workspaces.Get(ctx, workspaceID) (*Workspace, error)
GET/v1/organizations/workspaces/{workspace_id}
Обновить рабочее пространство
client.Organization.Workspaces.Update(ctx, workspaceID, body) (*Workspace, error)
POST/v1/organizations/workspaces/{workspace_id}
Архивировать рабочее пространство
client.Organization.Workspaces.Archive(ctx, workspaceID) (*Workspace, error)
POST/v1/organizations/workspaces/{workspace_id}/archive
Models
type AllowedInferenceGeo string
One of the following:
const AllowedInferenceGeoGlobal AllowedInferenceGeo = "global"
const AllowedInferenceGeoUs AllowedInferenceGeo = "us"
type DataResidency struct { AllowedInferenceGeos; DefaultInferenceGeo; WorkspaceGeo }
AllowedInferenceGeos DataResidencyAllowedInferenceGeosUnion

Permitted inference geo values. 'unrestricted' means all geos are allowed.

One of the following:
One of the following:
const AllowedInferenceGeoGlobal AllowedInferenceGeo = "global"
const AllowedInferenceGeoUs AllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo DataResidencyDefaultInferenceGeo

Default inference geo applied when requests omit the parameter.

One of the following:
const DataResidencyDefaultInferenceGeoGlobal DataResidencyDefaultInferenceGeo = "global"
const DataResidencyDefaultInferenceGeoUs DataResidencyDefaultInferenceGeo = "us"
WorkspaceGeo DataResidencyWorkspaceGeo

Geographic region for workspace data storage. Immutable after creation.

type DataResidencyCreateConfigParam struct { AllowedInferenceGeos; DefaultInferenceGeo; WorkspaceGeo }
AllowedInferenceGeos DataResidencyCreateConfigAllowedInferenceGeosUnionParam Optional

Permitted inference geo values. Defaults to 'unrestricted' if omitted, which allows all geos. Use the string 'unrestricted' to allow all geos, or a list of specific geos.

One of the following:
One of the following:
const AllowedInferenceGeoGlobal AllowedInferenceGeo = "global"
const AllowedInferenceGeoUs AllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo DataResidencyCreateConfigDefaultInferenceGeo Optional

Default inference geo applied when requests omit the parameter. Defaults to 'global' if omitted. Must be a member of allowed_inference_geos unless allowed_inference_geos is "unrestricted".

One of the following:
const DataResidencyCreateConfigDefaultInferenceGeoGlobal DataResidencyCreateConfigDefaultInferenceGeo = "global"
const DataResidencyCreateConfigDefaultInferenceGeoUs DataResidencyCreateConfigDefaultInferenceGeo = "us"
WorkspaceGeo DataResidencyCreateConfigWorkspaceGeo Optional

Geographic region for workspace data storage. Immutable after creation. Defaults to 'us' if omitted.

type DataResidencyUpdateConfigParam struct { AllowedInferenceGeos; DefaultInferenceGeo }
AllowedInferenceGeos DataResidencyUpdateConfigAllowedInferenceGeosUnionParam Optional

Permitted inference geo values. Use 'unrestricted' to allow all geos, or a list of specific geos.

One of the following:
One of the following:
const AllowedInferenceGeoGlobal AllowedInferenceGeo = "global"
const AllowedInferenceGeoUs AllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo DataResidencyUpdateConfigDefaultInferenceGeo Optional

Default inference geo applied when requests omit the parameter. Must be a member of allowed_inference_geos unless allowed_inference_geos is "unrestricted".

One of the following:
const DataResidencyUpdateConfigDefaultInferenceGeoGlobal DataResidencyUpdateConfigDefaultInferenceGeo = "global"
const DataResidencyUpdateConfigDefaultInferenceGeoUs DataResidencyUpdateConfigDefaultInferenceGeo = "us"
type NoBillingWorkspaceRole string
One of the following:
const NoBillingWorkspaceRoleWorkspaceAdmin NoBillingWorkspaceRole = "workspace_admin"
const NoBillingWorkspaceRoleWorkspaceDeveloper NoBillingWorkspaceRole = "workspace_developer"
const NoBillingWorkspaceRoleWorkspaceRestrictedDeveloper NoBillingWorkspaceRole = "workspace_restricted_developer"
const NoBillingWorkspaceRoleWorkspaceUser NoBillingWorkspaceRole = "workspace_user"
type Workspace struct { Type: "workspace"; ID; ArchivedAt; /* 7 more */ }
type WorkspaceMember struct { Type: "workspace_member"; UserID; WorkspaceID; WorkspaceRole }
Type WorkspaceMember

Object type.

For Workspace Members, this is always "workspace_member".

defaultworkspace_member
UserID string

ID of the User.

WorkspaceID string

ID of the Workspace.

WorkspaceRole WorkspaceRole

Role of the Workspace Member.

One of the following:
const WorkspaceRoleWorkspaceAdmin WorkspaceRole = "workspace_admin"
const WorkspaceRoleWorkspaceBilling WorkspaceRole = "workspace_billing"
const WorkspaceRoleWorkspaceDeveloper WorkspaceRole = "workspace_developer"
const WorkspaceRoleWorkspaceRestrictedDeveloper WorkspaceRole = "workspace_restricted_developer"
const WorkspaceRoleWorkspaceUser WorkspaceRole = "workspace_user"
type WorkspaceRole string
One of the following:
const WorkspaceRoleWorkspaceAdmin WorkspaceRole = "workspace_admin"
const WorkspaceRoleWorkspaceBilling WorkspaceRole = "workspace_billing"
const WorkspaceRoleWorkspaceDeveloper WorkspaceRole = "workspace_developer"
const WorkspaceRoleWorkspaceRestrictedDeveloper WorkspaceRole = "workspace_restricted_developer"
const WorkspaceRoleWorkspaceUser WorkspaceRole = "workspace_user"

Рабочие пространстваОграничения скорости

Список ограничений скорости рабочего пространства
client.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[WorkspaceRateLimit], error)
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

Возвращает список ограничений скорости рабочего пространства.

Рабочие пространстваУчастники

Список участников рабочего пространства
client.Organization.Workspaces.Members.List(ctx, workspaceID, query) (*Page[WorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/members
Создать участника рабочего пространства
client.Organization.Workspaces.Members.Add(ctx, workspaceID, body) (*WorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members
Получить участника рабочего пространства
client.Organization.Workspaces.Members.Get(ctx, userID, query) (*WorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Обновить участника рабочего пространства
client.Organization.Workspaces.Members.Update(ctx, userID, params) (*WorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Удалить участника рабочего пространства
client.Organization.Workspaces.Members.Remove(ctx, userID, body) (*OrganizationWorkspaceMemberRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/members/{user_id}

Рабочие пространстваСервисные аккаунты

Список сервисных аккаунтов — участников рабочего пространства
client.Organization.Workspaces.ServiceAccounts.List(ctx, workspaceID, query) (*PageCursor[ServiceAccountWorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.

Добавить сервисный аккаунт в рабочее пространство
client.Organization.Workspaces.ServiceAccounts.Add(ctx, workspaceID, body) (*ServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.

Получить членство сервисного аккаунта в рабочем пространстве
client.Organization.Workspaces.ServiceAccounts.Get(ctx, serviceAccountID, query) (*ServiceAccountWorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.

Обновить членство сервисного аккаунта в рабочем пространстве
client.Organization.Workspaces.ServiceAccounts.Update(ctx, serviceAccountID, params) (*ServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.

Удалить сервисный аккаунт из рабочего пространства
client.Organization.Workspaces.ServiceAccounts.Remove(ctx, serviceAccountID, body) (*OrganizationWorkspaceServiceAccountRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.