Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

attribute-requests changedmanage-claude/user-profiles/attribute-requests

Nearest release: v2.1.333, published an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+32added
Lines−27removed
From line 6 where the diff opens
First seen 30 Nov 2026 this site's first read of the page
Recorded edits3to this page, all time

### Which role a credential needs

The whole hunk

from line 6, old and new numbered
/
lines
from line 6
66 
77User profiles tell Anthropic which of your end customers each API request is for. That way, a safety enforcement action, such as a restriction or a ban, can apply to one end customer instead of your whole organization. If you aren’t sure that you need user profiles, see [How user profiles work](https://platform.claude.com/docs/en/manage-claude/user-profiles/how-user-profiles-work).
88 
9If you write the code that serves your end customers, you create a user profile for each one with `POST /v1/user_profiles`. You keep the opaque `uprof_` ID it returns and send it on every request you make for them.
9In the code that serves your end customers, you create a user profile for each one with `POST /v1/user_profiles`. You keep the opaque `uprof_` ID it returns and send it on every request you make for them.
1010 
1111If you use Claude through a cloud platform, that platform determines which organization holds your user profiles and how you send their IDs. Read [Use user profiles on a cloud platform](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms) before you create your first user profile.
1212 
from line 15
1515You need the following:
1616 
1717* **An organization for end-customer traffic:** Keep it separate from the one for your own usage. Separate workspaces in the same organization aren’t enough. Only the organization for end-customer traffic needs user profiles. To create another organization on the Claude API, see “How to create a new organization” in [Create and manage Workspaces in the Claude Console](https://support.claude.com/en/articles/9796807).
18* **Credentials for that organization:** To create and manage user profiles, use a [workload identity federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) or OAuth token with the `workspace:developer` scope, or an API key. A workload identity federation token is a short-lived Anthropic token that you get in exchange for one from your own identity provider. If the credential belongs to a person, they need the developer, admin, or owner role in the organization, because a workspace role isn’t enough. If it belongs to a service account, the developer or admin role in the organization or the workspace works. To send user profile IDs, any credential from that organization that can call the Messages API works. You don’t need an Admin API key.
19* **On a Microsoft Foundry deployment hosted on Anthropic, a linked organization:** Anthropic has to link the organization that holds your Foundry resource to the one that holds your user profiles. Until then, your Foundry requests can’t carry user profile IDs. See [If you use Microsoft Foundry](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#microsoft-foundry).
18* **Credentials for that organization:** To create and manage user profiles, use a [workload identity federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) or OAuth token with the `workspace:developer` scope, or a Developer API key. A workload identity federation token is a short-lived Anthropic token that you get in exchange for one from your own identity provider. The credential also needs [the developer role or higher](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#which-role-a-credential-needs). A person needs it in the organization, because a workspace role isn’t enough. To send user profile IDs, any credential from that organization that can call the Messages API works. You don’t need an Admin API key.
19* **On a Microsoft Foundry deployment hosted on Anthropic, a linked organization:** The organization that holds your Foundry resource has to be linked to the one that holds your user profiles. Until then, your Foundry requests can’t carry those user profile IDs. See [If you use Microsoft Foundry](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#microsoft-foundry).
2020 
2121## Decide who gets a user profile
2222 
from line 61
6161 
6262### Send the create request
6363 
64The cURL samples on this page send an access token from `ANTHROPIC_AUTH_TOKEN`, such as a [workload identity federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#authenticate-from-your-workload) token. Set that variable only in the shell where you run them, because it takes precedence over federation environment variables and federation profiles.
65 
6664This example creates a user profile for a company that buys API access from you, so it sets `access_type` to `passthrough`. For an `application` user profile, leave `access_type` out.
6765 
6866<CodeGroup>
69 ```bash cURL
70 curl https://api.anthropic.com/v1/user_profiles \
71 -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
72 -H "anthropic-version: 2026-10-21" \
73 -H "content-type: application/json" \
74 -d '{
75 "name": "Acme Analytics, Inc.",
76 "access_type": "passthrough",
77 "external_user_details": {
78 "reference_id": "cust-8f2a1c",
79 "country": "US"
80 }
81 }'
82 ```
67 <CodeGroupItem>
68 This sample and others like it on this page send an access token from `ANTHROPIC_AUTH_TOKEN`, such as a [workload identity federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#authenticate-from-your-workload) token. Set that variable only in the shell where you run them, because it takes precedence over federation environment variables and federation profiles.
8369 
70 ```bash cURL
71 curl https://api.anthropic.com/v1/user_profiles \
72 -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
73 -H "anthropic-version: 2026-10-21" \
74 -H "content-type: application/json" \
75 -d '{
76 "name": "Acme Analytics, Inc.",
77 "access_type": "passthrough",
78 "external_user_details": {
79 "reference_id": "cust-8f2a1c",
80 "country": "US"
81 }
82 }'
83 ```
84 </CodeGroupItem>
85 
8486 ```bash CLI
8587 ant user-profiles create \
8688 --name "Acme Analytics, Inc." \
from line 229
227229 
228230Anthropic sets the following fields itself, so leave them out of your request:
229231 
230* `programs`: The end customer’s status in each Anthropic program, such as the Cyber Verification Program. Attribution doesn’t use this field. For what its values mean, see [which programs apply to a user profile](https://platform.claude.com/docs/en/manage-claude/user-profiles-verification-portal#after-the-end-customer-links-the-profile).
232* `programs`: The end customer’s status in each Anthropic program that the API reports, such as the Cyber Verification Program. Attribution doesn’t use this field. For what its values mean, see [a user profile’s program statuses](https://platform.claude.com/docs/en/manage-claude/user-profiles-verification-portal#after-the-end-customer-links-the-profile).
231233* `enforcement_status` and `enforcement_actions`: Restrictions or bans that Anthropic has open on the end customer. See [Check whether Anthropic has restricted or banned a user profile](https://platform.claude.com/docs/en/manage-claude/user-profiles/manage-profiles#check-whether-anthropic-has-restricted-or-banned-a-profile).
232234 
233235### Register an existing customer base
from line 369
367369 ```
368370</CodeGroup>
369371 
370Send the header the same way on [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting), [Message Batches](https://platform.claude.com/docs/en/build-with-claude/batch-processing), and [OpenAI SDK compatibility](https://platform.claude.com/docs/en/cli-sdks-libraries/libraries/openai-sdk) requests. A batch’s header applies to every request in it, so put only one end customer’s requests in each batch.
372Send the header the same way on [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting), [Message Batches](https://platform.claude.com/docs/en/build-with-claude/batch-processing), and [OpenAI SDK compatibility](https://platform.claude.com/docs/en/cli-sdks-libraries/libraries/openai-sdk) requests. A batch’s header applies to every request in it, so put only one end customer’s requests in [each batch](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-you-send-a-batch).
371373 
372374On Amazon Bedrock, the ID goes in the request body instead, and only on the [models that accept a user profile ID](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#amazon-bedrock-models). To find where the ID goes on each cloud platform, see [Use user profiles on a cloud platform](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms).
373375 
from line 376
374376Here’s how the API handles the ID:
375377 
376378* **No ID:** Anthropic counts the request as your own usage.
377* **A malformed ID or one your organization can’t use:** The Claude API rejects the request with a `400`. See [If a request returns a `400`](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400).
378* **An ID on a batch:** When you create the batch, the API checks only the ID’s format, unless the workspace has a user profile attached. See [If you send a batch](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-you-send-a-batch).
379* **A malformed or unrecognized ID:** The Claude API rejects the request with a `400`. See [If a request returns a `400`](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400).
379380 
380381To bill a user profile’s requests to that customer’s own Claude organization, see [Linked billing](https://platform.claude.com/docs/en/manage-claude/oauth-apps/linked-billing).
381382 
from line 386
385386 
386387## Rules and special cases
387388 
389### Which role a credential needs
390 
391These rules apply to a credential that creates or manages user profiles. If the credential belongs to a person, they need the developer, admin, owner, or primary owner role in the organization. If the credential belongs to a service account, the developer or admin role in the organization or the workspace works.
392 
388393### If a workspace has a user profile attached
389394 
390395Once a workspace has a user profile attached, every inference request through it must carry that user profile’s ID. The API rejects a request with a different ID or none. You attach a user profile by setting `user_profile_id` in [Create Workspace](https://platform.claude.com/docs/en/api/organization/workspaces/create) or [Update Workspace](https://platform.claude.com/docs/en/api/organization/workspaces/update). Only deleting the user profile clears the attachment.
from line 396
391396 
392397### If a request returns a `400`
393398 
394The Claude API and Claude Platform on AWS check the ID on every request. So do Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry deployments [hosted on Anthropic](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options). If the check fails, they return a `400` error of type `invalid_request_error`. The check fails in cases such as these:
399The Claude API and Claude Platform on AWS check the ID on every request. So do Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry deployments [hosted on Anthropic](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options). If the check fails, they return a `400` error of type `invalid_request_error`. The check can fail in cases such as these:
395400 
396401* The ID is malformed.
397* The ID belongs to another organization, including one of yours on another platform, such as Claude Platform on AWS.
398* The request goes to a Microsoft Foundry deployment hosted on Anthropic before [Anthropic links the organization that holds your Foundry resource](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#microsoft-foundry) to the organization that created the user profile.
402* Outside Microsoft Foundry, the request comes from one organization, and another organization created the user profile. This can happen even if both organizations are yours, such as one on the Claude API and one on Claude Platform on AWS. To avoid that, create the user profile and send its ID from the same organization.
403* On a Microsoft Foundry deployment hosted on Anthropic, [the organization that holds your Foundry resource isn’t linked](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#microsoft-foundry) to the one that created the user profile.
399404 
400405For Claude Models on Google Cloud (Google managed) and Amazon Bedrock, see [How each platform checks the ID](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#how-each-platform-checks-the-id).
401406 
402407### If you send a batch
403408 
404Unless the workspace has a [user profile attached](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-workspace-has-a-profile-attached), creating a message batch checks only the ID’s format, not whether the ID belongs to your organization. If a well-formed ID doesn’t belong to the organization that sends the batch, the batch is still created. Each request in it then fails with an `errored` result that contains an `invalid_request_error`.
409Unless the workspace has a [user profile attached](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-workspace-has-a-profile-attached), creating a message batch checks only the ID’s format. If a well-formed ID would fail the [rest of the check](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400), the batch is still created. Each request in it then fails with an `errored` result that contains an `invalid_request_error`.
405410 
Feedback