Créer un profil utilisateur
POST/v1/user_profiles
Register one of your end customers and get the ID to send on the requests you make for them.
See the User profiles guide for what to send.
Parameters
Returns
Créer un profil utilisateur
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go/v2"
"github.com/anthropics/anthropic-sdk-go/v2/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
userProfile, err := client.UserProfiles.New(context.TODO(), anthropic.UserProfileNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", userProfile.ID)
}Response 200
{
"id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
"access_type": "application",
"created_at": "2026-03-15T10:00:00Z",
"enforcement_actions": [],
"enforcement_status": "unrestricted",
"external_user_details": {
"account_status": "active",
"country": "US",
"email_hash": null,
"entity_type": "business",
"name_hash": null,
"onboarded_at": "2024-11-02T08:15:00Z",
"reference_id": "user_12345"
},
"metadata": {},
"name": "Example User",
"programs": {
"cyber": {
"requirements": null,
"status": "active",
"tiers": {
"a": {
"status": "inactive"
},
"b": {
"status": "inactive"
},
"c": {
"status": "inactive"
}
}
},
"efs": null
},
"type": "user_profile",
"updated_at": "2026-03-15T10:00:00Z"
}Returns Examples
Response 200
{
"id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
"access_type": "application",
"created_at": "2026-03-15T10:00:00Z",
"enforcement_actions": [],
"enforcement_status": "unrestricted",
"external_user_details": {
"account_status": "active",
"country": "US",
"email_hash": null,
"entity_type": "business",
"name_hash": null,
"onboarded_at": "2024-11-02T08:15:00Z",
"reference_id": "user_12345"
},
"metadata": {},
"name": "Example User",
"programs": {
"cyber": {
"requirements": null,
"status": "active",
"tiers": {
"a": {
"status": "inactive"
},
"b": {
"status": "inactive"
},
"c": {
"status": "inactive"
}
}
},
"efs": null
},
"type": "user_profile",
"updated_at": "2026-03-15T10:00:00Z"
}