Skip to content
Product Docs

Update User Claims

PATCH/api/v1/admin/users/{user_id}/claims

Additively update a user’s custom claims.

Claims in set_claims are added or overwritten; claims named in remove_claims are reset to their system default. Claims not referenced by either field are left unchanged, so a single claim can be changed without resending the full set. Returns the user’s resolved claims after the update.

Returns 404 if the user does not exist.

Global admin only.

Path ParametersExpand Collapse
user_id: string
Cookie ParametersExpand Collapse
session: optional string
Body ParametersJSONExpand Collapse
remove_claims: optional array of "allow_org_deletion" or "allowed_org_creation" or "api_datasource_access" or "maximum_org_creation"

Names of claims to reset to their system default.

One of the following:
"allow_org_deletion"
"allowed_org_creation"
"api_datasource_access"
"maximum_org_creation"
set_claims: optional object { allow_org_deletion, allowed_org_creation, api_datasource_access, maximum_org_creation }

A partial set of custom claims for additive updates.

Every field is optional. Only the claims explicitly provided in a request are added or overwritten; claims left unset are not touched, so callers can change a single claim without resending the full claim set.

allow_org_deletion: optional boolean

Whether the user is allowed to delete organizations.

allowed_org_creation: optional boolean

Whether the user is allowed to create organizations.

api_datasource_access: optional boolean

Whether the user is allowed to access API data sources.

maximum_org_creation: optional number

Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

ReturnsExpand Collapse
UserClaims object { claims, user_id }

A user’s fully resolved custom claims after applying system defaults.

claims: CustomClaims { allow_org_deletion, allowed_org_creation, api_datasource_access, maximum_org_creation }

The user’s resolved custom claims.

allow_org_deletion: optional boolean

Whether the user is allowed to delete organizations.

allowed_org_creation: optional boolean

Whether the user is allowed to create organizations.

api_datasource_access: optional boolean

Whether the user is allowed to access API data sources.

maximum_org_creation: optional number

Cap on how many organizations this user may create. None means unlimited. Only enforced when allowed_org_creation is True.

user_id: string

The user ID the claims belong to.

Update User Claims

curl https://api.cloud.llamaindex.ai/api/v1/admin/users/$USER_ID/claims \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '{}'
{
  "claims": {
    "allow_org_deletion": true,
    "allowed_org_creation": true,
    "api_datasource_access": true,
    "maximum_org_creation": 0
  },
  "user_id": "user_id"
}
Returns Examples
{
  "claims": {
    "allow_org_deletion": true,
    "allowed_org_creation": true,
    "api_datasource_access": true,
    "maximum_org_creation": 0
  },
  "user_id": "user_id"
}