Skip to main content

Module user_profiles

Module user_profiles 

Source
Available on crate feature user-profiles only.
Expand description

The User Profiles API (beta).

User profiles let your platform attach Anthropic-managed metadata and trust grants to your end users. A UserProfile carries:

  • your platform’s own external_id (e.g. your DB primary key) – not enforced unique server-side,
  • free-form metadata (≤16 keys),
  • trust_grants the user has been granted (e.g. for elevated content categories), keyed by grant name with TrustGrantStatus.

Trust grants are not granted directly via this API. Instead, call UserProfiles::create_enrollment_url to get a signed, short-lived URL that you redirect the end user to so they can complete the trust enrollment flow on Anthropic’s side.

§Beta

Every method automatically sends anthropic-beta: user-profiles-2026-03-24 (BetaHeader::UserProfiles). Override the beta version on the Client builder if a newer revision is current.

§Endpoints

MethodPathFunction
POST/v1/user_profilesUserProfiles::create
GET/v1/user_profilesUserProfiles::list
GET/v1/user_profiles/{user_profile_id}UserProfiles::get
POST/v1/user_profiles/{user_profile_id}UserProfiles::update
POST/v1/user_profiles/{user_profile_id}/enrollment_urlUserProfiles::create_enrollment_url

Structs§

CreateUserProfileRequest
Body for UserProfiles::create. Both fields optional.
EnrollmentUrl
A signed, short-lived enrollment URL returned by UserProfiles::create_enrollment_url.
ListUserProfilesParams
Query parameters for GET /v1/user_profiles.
TrustGrant
One trust grant on a UserProfile.
UpdateUserProfileRequest
Body for UserProfiles::update.
UserProfile
A user profile resource.
UserProfiles
Namespace handle for the User Profiles API.

Enums§

ListOrder
Sort order for list endpoints.
TrustGrantStatus
Status of a single trust grant on a UserProfile.