Skip to content
Product Docs

Get User Claims

client.Admin.Users.GetClaims(ctx, userID) (*UserClaims, error)
GET/api/v1/admin/users/{user_id}/claims

Get a user’s resolved custom claims.

Claims that have not been explicitly set fall back to their system default. Returns 404 if the user does not exist.

Global admin only.

ParametersExpand Collapse
userID string
ReturnsExpand Collapse
type UserClaims struct{…}

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

The user’s resolved custom claims.

AllowOrgDeletion boolOptional

Whether the user is allowed to delete organizations.

AllowedOrgCreation boolOptional

Whether the user is allowed to create organizations.

APIDatasourceAccess boolOptional

Whether the user is allowed to access API data sources.

MaximumOrgCreation int64Optional

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

UserID string

The user ID the claims belong to.

Get User Claims

package main

import (
  "context"
  "fmt"

  "github.com/run-llama/llamacloud-admin-go"
  "github.com/run-llama/llamacloud-admin-go/option"
)

func main() {
  client := llamacloudadmin.NewClient(
    option.WithAPIKey("My API Key"),
  )
  userClaims, err := client.Admin.Users.GetClaims(context.TODO(), "user_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", userClaims.UserID)
}
{
  "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"
}