v49

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-261319281.7 MB

Update User Profile

post/v1/user_profiles/{user_profile_id}?beta=true

Path parameters

user_profile_idstring required

Path parameter user_profile_id

Headers

anthropic-versionstring
anthropic-betastring

Request body

external_idstring nullable

If present, replaces the stored external_id. Omit to leave unchanged. Maximum 255 characters.

metadataobject

Key-value pairs to merge into the stored metadata. Keys provided overwrite existing values. To remove a key, set its value to an empty string. Keys not provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and values up to 512 characters.

namestring nullable

If present, replaces the stored name. Omit to leave unchanged. Maximum 255 characters.

relationship'external' | 'resold' | 'internal'

How the entity behind a user profile relates to the platform that owns the API key. external: an individual end-user of the platform. resold: a company the platform resells Claude access to. internal: the platform's own usage.

Example request

{
  "external_id": "user_12345"
}

Response

Successful response (OK)

idstring required

Unique identifier for this user profile, prefixed uprof_.

type'user_profile' required

Object type. Always user_profile.

external_idstring nullable

Platform's own identifier for this user. Not enforced unique.

namestring nullable

Display name of the entity this profile represents. For resold this is the resold-to company's name.

relationship'external' | 'resold' | 'internal' required

How the entity behind a user profile relates to the platform that owns the API key. external: an individual end-user of the platform. resold: a company the platform resells Claude access to. internal: the platform's own usage.

trust_grantsobject required

Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

created_atstring date-time required

A timestamp in RFC 3339 format

metadataobject required

Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

updated_atstring date-time required

A timestamp in RFC 3339 format

Example response

{
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "type": "user_profile",
  "external_id": "user_12345",
  "name": "Example User",
  "relationship": "external",
  "trust_grants": {
    "cyber": {
      "status": "active"
    }
  },
  "metadata": {},
  "created_at": "2026-03-15T10:00:00Z",
  "updated_at": "2026-03-15T10:00:00Z"
}