Claude Platform Docs

使用者設定檔

註冊您的平台所服務的終端客戶,讓每個請求都能指明其服務對象。若要開始使用,請參閱使用者設定檔指南。

建立使用者設定檔
client.Beta.UserProfiles.New(ctx, params) (*BetaUserProfile, error)
POST/v1/user_profiles

註冊您的一位終端客戶,並取得 ID,以便在您代其發出的請求中傳送。

列出使用者設定檔
client.Beta.UserProfiles.List(ctx, params) (*PageCursor[BetaUserProfile], error)
GET/v1/user_profiles

列出您組織中的使用者設定檔,預設以最新的優先排列。

取得使用者設定檔
client.Beta.UserProfiles.Get(ctx, userProfileID, query) (*BetaUserProfile, error)
GET/v1/user_profiles/{user_profile_id}

依 ID 取得使用者設定檔,以檢查為其儲存的詳細資訊。

更新使用者設定檔
client.Beta.UserProfiles.Update(ctx, userProfileID, params) (*BetaUserProfile, error)
POST/v1/user_profiles/{user_profile_id}

變更使用者設定檔的詳細資訊,您未傳送的欄位將維持不變。

刪除使用者設定檔
client.Beta.UserProfiles.Delete(ctx, userProfileID, body) (*BetaDeletedUserProfile, error)
DELETE/v1/user_profiles/{user_profile_id}

刪除使用者設定檔,例如在終端客戶關閉其帳戶時。

建立註冊 URL
client.Beta.UserProfiles.NewEnrollmentURL(ctx, userProfileID, body) (*BetaUserProfileEnrollmentURL, error)
POST/v1/user_profiles/{user_profile_id}/enrollment_url

從 Claude Platform on AWS 建立連結,將該設定檔的終端客戶導向 Verification Portal。

Models
type BetaDeletedUserProfile struct { Type: "user_profile_deleted"; ID }
Type UserProfileDeleted

Object type. Always user_profile_deleted.

ID string

Identifier of the deleted user profile, prefixed uprof_.

type BetaUserProfile struct { Type: "user_profile"; ID; CreatedAt; /* 8 more */ }

A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.

A Messages, Message Batches or token counting request can send a profile's id in the anthropic-user-profile-id header to attribute the request to that entity.

type BetaUserProfileEnrollmentURL struct { Type: "enrollment_url"; ExpiresAt; URL }

A URL to give to the entity that a user profile represents, so that the entity can enroll in a program.

Type EnrollmentURL

Object type. Always enrollment_url.

ExpiresAt Time

When this enrollment URL expires, in RFC 3339 format.

formatdate-time
URL string

Enrollment URL to send to the end user. Valid until expires_at.

type BetaUserProfileExternalUserDetails struct { AccountStatus; Country; EmailHash; /* 4 more */ }

Details about the entity this profile represents, as the platform states them. Anthropic does not verify them. Every field is present, null until the platform supplies a value.

type BetaUserProfileExternalUserDetailsParams struct { AccountStatus; Country; EmailHash; /* 4 more */ }
type BetaUserProfileTrustGrant struct { Status }

The status of one trust grant on a user profile, listed in the profile's trust_grants map under the grant's name.

Status BetaUserProfileTrustGrantStatus

Status of the trust grant.

One of the following:
const BetaUserProfileTrustGrantStatusActive BetaUserProfileTrustGrantStatus = "active"
const BetaUserProfileTrustGrantStatusPending BetaUserProfileTrustGrantStatus = "pending"
const BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"

使用者設定檔動作 URL

建立動作 URL
client.Beta.UserProfiles.ActionURLs.New(ctx, userProfileID, params) (*BetaUserProfileActionURL, error)
POST/v1/user_profiles/{user_profile_id}/action_urls

建立連結,將該設定檔的終端客戶導向 Verification Portal。

使用者設定檔供應商Google資料控制項

取得 Google-Managed 資料控制項
client.Beta.UserProfiles.Providers.Google.DataControls.Get(ctx, userProfileID, query) (*BetaGoogleManagedDataControls, error)
GET/v1/user_profiles/{user_profile_id}/providers/google/data_controls
Requires anthropic-beta: google-managed-data-controls-2026-09-01. Learn how to send beta headers.

取得設定檔用於 Google Cloud's Agent Platform 上的 Claude 的加密金鑰與儲存貯體,以及每個區域的狀態。

更新 Google-Managed 資料控制項
client.Beta.UserProfiles.Providers.Google.DataControls.Update(ctx, userProfileID, params) (*BetaGoogleManagedDataControls, error)
POST/v1/user_profiles/{user_profile_id}/providers/google/data_controls
Requires anthropic-beta: google-managed-data-controls-2026-09-01. Learn how to send beta headers.

開啟或關閉控制項,或變更為某個區域設定的金鑰或儲存貯體。您未指定的控制項與區域將維持不變。