Claude Platform Docs

Espaces de travail

Lister les espaces de travail
client.Organization.Workspaces.List(ctx, query) (*Page[Workspace], error)
GET/v1/organizations/workspaces
Créer un espace de travail
client.Organization.Workspaces.New(ctx, body) (*Workspace, error)
POST/v1/organizations/workspaces
Obtenir un espace de travail
client.Organization.Workspaces.Get(ctx, workspaceID) (*Workspace, error)
GET/v1/organizations/workspaces/{workspace_id}
Mettre à jour un espace de travail
client.Organization.Workspaces.Update(ctx, workspaceID, body) (*Workspace, error)
POST/v1/organizations/workspaces/{workspace_id}
Archiver un espace de travail
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"

Espaces de travailLimites de débit

Lister les limites de débit d'un espace de travail
client.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[WorkspaceRateLimit], error)
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

Listez les « rate limits » (limites de débit) d'un espace de travail.

Espaces de travailMembres

Lister les membres d'un espace de travail
client.Organization.Workspaces.Members.List(ctx, workspaceID, query) (*Page[WorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/members
Créer un membre d'espace de travail
client.Organization.Workspaces.Members.Add(ctx, workspaceID, body) (*WorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members
Obtenir un membre d'espace de travail
client.Organization.Workspaces.Members.Get(ctx, userID, query) (*WorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Mettre à jour un membre d'espace de travail
client.Organization.Workspaces.Members.Update(ctx, userID, params) (*WorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members/{user_id}
Supprimer un membre d'espace de travail
client.Organization.Workspaces.Members.Remove(ctx, userID, body) (*OrganizationWorkspaceMemberRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/members/{user_id}

Espaces de travailComptes de service

Lister les comptes de service membres d'un espace de travail
client.Organization.Workspaces.ServiceAccounts.List(ctx, workspaceID, query) (*PageCursor[ServiceAccountWorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts

Nécessite un jeton d'accès OAuth avec la portée org:admin, obtenu via ant auth login --scope org:admin ou une règle de workload identity federation (fédération d'identité de charge de travail) ; les clés Admin API ne sont pas acceptées. Consultez Gérer WIF avec l'Admin API.

Créer un compte de service membre d'un espace de travail
client.Organization.Workspaces.ServiceAccounts.Add(ctx, workspaceID, body) (*ServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts

Nécessite un jeton d'accès OAuth avec la portée org:admin, obtenu via ant auth login --scope org:admin ou une règle de workload identity federation (fédération d'identité de charge de travail) ; les clés Admin API ne sont pas acceptées. Consultez Gérer WIF avec l'Admin API.

Obtenir un compte de service membre d'un espace de travail
client.Organization.Workspaces.ServiceAccounts.Get(ctx, serviceAccountID, query) (*ServiceAccountWorkspaceMember, error)
GET/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Nécessite un jeton d'accès OAuth avec la portée org:admin, obtenu via ant auth login --scope org:admin ou une règle de workload identity federation (fédération d'identité de charge de travail) ; les clés Admin API ne sont pas acceptées. Consultez Gérer WIF avec l'Admin API.

Mettre à jour un compte de service membre d'un espace de travail
client.Organization.Workspaces.ServiceAccounts.Update(ctx, serviceAccountID, params) (*ServiceAccountWorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Nécessite un jeton d'accès OAuth avec la portée org:admin, obtenu via ant auth login --scope org:admin ou une règle de workload identity federation (fédération d'identité de charge de travail) ; les clés Admin API ne sont pas acceptées. Consultez Gérer WIF avec l'Admin API.

Supprimer un compte de service membre d'un espace de travail
client.Organization.Workspaces.ServiceAccounts.Remove(ctx, serviceAccountID, body) (*OrganizationWorkspaceServiceAccountRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Nécessite un jeton d'accès OAuth avec la portée org:admin, obtenu via ant auth login --scope org:admin ou une règle de fédération d'identité de charge de travail ; les clés API Admin ne sont pas acceptées. Consultez Gérer WIF avec l'API Admin.