Claude Platform Docs

Espaços de trabalho

Listar workspaces
client.Beta.Organization.Workspaces.List(ctx, params) (*Page[BetaWorkspace], error)
GET/v1/organizations/workspaces
Criar workspace
client.Beta.Organization.Workspaces.New(ctx, params) (*BetaWorkspace, error)
POST/v1/organizations/workspaces
Obter workspace
client.Beta.Organization.Workspaces.Get(ctx, workspaceID, query) (*BetaWorkspace, error)
GET/v1/organizations/workspaces/{workspace_id}
Atualizar workspace
client.Beta.Organization.Workspaces.Update(ctx, workspaceID, params) (*BetaWorkspace, error)
POST/v1/organizations/workspaces/{workspace_id}
Arquivar workspace
client.Beta.Organization.Workspaces.Archive(ctx, workspaceID, body) (*BetaWorkspace, error)
POST/v1/organizations/workspaces/{workspace_id}/archive
Models
type BetaAllowedInferenceGeo string
One of the following:
const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"
const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"
type BetaAnthropicHumanReview struct { Type }

The Workspace's human review setting.

Type BetaAnthropicHumanReviewType
One of the following:
const BetaAnthropicHumanReviewTypeDisabled BetaAnthropicHumanReviewType = "disabled"
const BetaAnthropicHumanReviewTypeEnabled BetaAnthropicHumanReviewType = "enabled"
type BetaAnthropicHumanReviewParam struct { Type }

Whether Anthropic's human review applies to the Workspace's inference data.

Type BetaAnthropicHumanReviewParamType
One of the following:
const BetaAnthropicHumanReviewParamTypeDisabled BetaAnthropicHumanReviewParamType = "disabled"
const BetaAnthropicHumanReviewParamTypeEnabled BetaAnthropicHumanReviewParamType = "enabled"
type BetaDataResidency struct { AllowedInferenceGeos; DefaultInferenceGeo; WorkspaceGeo }
AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion

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

One of the following:
One of the following:
const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"
const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo

Default inference geo applied when requests omit the parameter.

One of the following:
const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"
const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"
WorkspaceGeo BetaDataResidencyWorkspaceGeo

Geographic region for workspace data storage. Immutable after creation.

type BetaDataResidencyCreateConfigParam struct { AllowedInferenceGeos; DefaultInferenceGeo; WorkspaceGeo }
AllowedInferenceGeos BetaDataResidencyCreateConfigAllowedInferenceGeosUnionParam 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 BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"
const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo BetaDataResidencyCreateConfigDefaultInferenceGeo 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 BetaDataResidencyCreateConfigDefaultInferenceGeoGlobal BetaDataResidencyCreateConfigDefaultInferenceGeo = "global"
const BetaDataResidencyCreateConfigDefaultInferenceGeoUs BetaDataResidencyCreateConfigDefaultInferenceGeo = "us"
WorkspaceGeo BetaDataResidencyCreateConfigWorkspaceGeo Optional

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

type BetaDataResidencyUpdateConfigParam struct { AllowedInferenceGeos; DefaultInferenceGeo }
AllowedInferenceGeos BetaDataResidencyUpdateConfigAllowedInferenceGeosUnionParam 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 BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"
const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"
Unrestricted
DefaultInferenceGeo BetaDataResidencyUpdateConfigDefaultInferenceGeo 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 BetaDataResidencyUpdateConfigDefaultInferenceGeoGlobal BetaDataResidencyUpdateConfigDefaultInferenceGeo = "global"
const BetaDataResidencyUpdateConfigDefaultInferenceGeoUs BetaDataResidencyUpdateConfigDefaultInferenceGeo = "us"
type BetaExternalStorageMember struct { Type: "external"; ExternalStorageID }

The organization's External Storage that external_storage_id names.

Type External
defaultexternal
ExternalStorageID string

The External Storage ID, which starts with estrg_. Through Claude Platform on AWS, storage whose provider_config.type is aws has its bucket ARN as its ID instead: arn:<partition>:s3:::<bucket_name>, where <partition> is the partition of the bucket's region.

type BetaExternalStorageMemberParam struct { Type: "external"; ExternalStorageID }

The organization's External Storage that external_storage_id names.

Type External
ExternalStorageID string

The External Storage ID, which starts with estrg_. Through Claude Platform on AWS, storage whose provider_config.type is aws has its bucket ARN as its ID instead: arn:<partition>:s3:::<bucket_name>, where <partition> is the partition of the bucket's region.

type BetaHumanReviewOnWithExternalStorageErrorDetails struct { ErrorCode }
ErrorCode BetaHumanReviewOnWithExternalStorageErrorCode
type BetaInferenceDataPrivacy struct { HumanReview; SafeguardsStorage; TranscriptsStorage }
type BetaInferenceDataPrivacyCreateParam struct { HumanReview; SafeguardsStorage; TranscriptsStorage }

Where the Workspace's retained inference data and transcript copies go, and whether Anthropic's human review applies. A member cannot be null; omit it instead.

type BetaInferenceDataPrivacyUpdateParam struct { HumanReview; SafeguardsStorage; TranscriptsStorage }

Changes to where the Workspace's retained inference data and transcript copies go, and to whether Anthropic's human review applies. An omitted member is unchanged; a member cannot be null.

type BetaInternalStorage struct { Type: "internal" }

No External Storage for this purpose.

Type Internal
defaultinternal
type BetaInternalStorageParam struct { Type: "internal" }

No External Storage for this purpose.

Type Internal
type BetaNoBillingWorkspaceRole string
One of the following:
const BetaNoBillingWorkspaceRoleWorkspaceAdmin BetaNoBillingWorkspaceRole = "workspace_admin"
const BetaNoBillingWorkspaceRoleWorkspaceDeveloper BetaNoBillingWorkspaceRole = "workspace_developer"
const BetaNoBillingWorkspaceRoleWorkspaceRestrictedDeveloper BetaNoBillingWorkspaceRole = "workspace_restricted_developer"
const BetaNoBillingWorkspaceRoleWorkspaceUser BetaNoBillingWorkspaceRole = "workspace_user"
type BetaStorageMemberUnion interface{…}
One of the following:
type BetaInternalStorage struct { Type: "internal" }

No External Storage for this purpose.

Type Internal
defaultinternal
type BetaExternalStorageMember struct { Type: "external"; ExternalStorageID }

The organization's External Storage that external_storage_id names.

Type External
defaultexternal
ExternalStorageID string

The External Storage ID, which starts with estrg_. Through Claude Platform on AWS, storage whose provider_config.type is aws has its bucket ARN as its ID instead: arn:<partition>:s3:::<bucket_name>, where <partition> is the partition of the bucket's region.

type BetaStorageMemberParamUnion interface{…}
One of the following:
type BetaInternalStorageParam struct { Type: "internal" }

No External Storage for this purpose.

Type Internal
type BetaExternalStorageMemberParam struct { Type: "external"; ExternalStorageID }

The organization's External Storage that external_storage_id names.

Type External
ExternalStorageID string

The External Storage ID, which starts with estrg_. Through Claude Platform on AWS, storage whose provider_config.type is aws has its bucket ARN as its ID instead: arn:<partition>:s3:::<bucket_name>, where <partition> is the partition of the bucket's region.

type BetaTranscriptsStorageRequiredErrorDetails struct { ErrorCode }
ErrorCode BetaTranscriptsStorageRequiredErrorCode
type BetaWorkspace struct { Type: "workspace"; ID; ArchivedAt; /* 9 more */ }
type BetaWorkspaceChangedConcurrentlyErrorDetails struct { ErrorCode; Field }
ErrorCode BetaWorkspaceChangedConcurrentlyErrorCode

The request field whose change was refused. Other values may be returned. The value is a name with no data of its own.

type BetaWorkspaceChangedConcurrentlyField string
type BetaWorkspaceMember 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 BetaWorkspaceRole

Role of the Workspace Member.

One of the following:
const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"
const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"
const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"
const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"
const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"
type BetaWorkspaceRole string
One of the following:
const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"
const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"
const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"
const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"
const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"
Errors
const ErrorCodeBetaHumanReviewOnWithExternalStorage ErrorCode = "human_review_on_with_external_storage"⁠HTTP status 400

The request would leave the Workspace with inference_data_privacy.safeguards_storage set to External Storage and inference_data_privacy.human_review enabled. Anthropic doesn't offer human review of data in a customer's own storage. Set human_review to disabled, or safeguards_storage to internal.

const ErrorCodeBetaTranscriptsStorageRequired ErrorCode = "transcripts_storage_required"⁠HTTP status 400

In an organization managed through AWS or Google Cloud, the request would leave the Workspace with inference_data_privacy.human_review disabled and inference_data_privacy.transcripts_storage not set to External Storage. With human review disabled, the organization reviews its own flagged requests, and it receives them only in that storage.

const ErrorCodeBetaWorkspaceChangedConcurrently ErrorCode = "workspace_changed_concurrently"⁠HTTP status 409

Another request changed the Workspace, so this request left the setting named in field as it is. The error's message says which of this request's other changes are in place. Read the Workspace and send the request again if you still want the change.

Espaços de trabalhoLimites de taxa

Listar limites de taxa do workspace
client.Beta.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[BetaWorkspaceRateLimit], error)
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

Liste os limites de taxa de um workspace.

Definir limites de taxa do workspace
client.Beta.Organization.Workspaces.RateLimits.Update(ctx, rateLimitID, params) (*BetaWorkspaceRateLimit, error)
POST/v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id}

Define ou remove substituições de limite de taxa para um grupo de limite de taxa em um workspace.

Espaços de trabalhoMembros

Listar membros do workspace
client.Beta.Organization.Workspaces.Members.List(ctx, workspaceID, query) (*Page[BetaWorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/members
Criar membro do workspace
client.Beta.Organization.Workspaces.Members.Add(ctx, workspaceID, body) (*BetaWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members
Obter membro do workspace
client.Beta.Organization.Workspaces.Members.Get(ctx, userID, query) (*BetaWorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Atualizar membro do workspace
client.Beta.Organization.Workspaces.Members.Update(ctx, userID, params) (*BetaWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Excluir membro do workspace
client.Beta.Organization.Workspaces.Members.Remove(ctx, userID, body) (*BetaOrganizationWorkspaceMemberRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/members/{user_id}

Espaços de trabalhoContas de serviço

Listar membros de workspace de conta de serviço
client.Beta.Organization.Workspaces.ServiceAccounts.List(ctx, workspaceID, params) (*PageCursor[BetaServiceAccountWorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts

Requer um token de acesso OAuth com o escopo org:admin, obtido via ant auth login --scope org:admin ou uma regra de federação de identidade de workload; chaves de Admin API não são aceitas. Consulte Gerenciar WIF com a Admin API.

Criar membro de workspace de conta de serviço
client.Beta.Organization.Workspaces.ServiceAccounts.Add(ctx, workspaceID, params) (*BetaServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts

Requer um token de acesso OAuth com o escopo org:admin, obtido via ant auth login --scope org:admin ou uma regra de federação de identidade de workload; chaves de Admin API não são aceitas. Consulte Gerenciar WIF com a Admin API.

Obter membro de workspace de conta de serviço
client.Beta.Organization.Workspaces.ServiceAccounts.Get(ctx, serviceAccountID, params) (*BetaServiceAccountWorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Requer um token de acesso OAuth com o escopo org:admin, obtido via ant auth login --scope org:admin ou uma regra de federação de identidade de workload; chaves de Admin API não são aceitas. Consulte Gerenciar WIF com a Admin API.

Atualizar membro de workspace de conta de serviço
client.Beta.Organization.Workspaces.ServiceAccounts.Update(ctx, serviceAccountID, params) (*BetaServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Requer um token de acesso OAuth com o escopo org:admin, obtido via ant auth login --scope org:admin ou uma regra de federação de identidade de workload; chaves de Admin API não são aceitas. Consulte Gerenciar WIF com a Admin API.

Excluir membro de workspace de conta de serviço
client.Beta.Organization.Workspaces.ServiceAccounts.Remove(ctx, serviceAccountID, params) (*BetaOrganizationWorkspaceServiceAccountRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Requer um token de acesso OAuth com o escopo org:admin, obtido via ant auth login --scope org:admin ou por uma regra de federação de identidade de carga de trabalho; chaves de API de Admin não são aceitas. Consulte Gerenciar WIF com a Admin API.