PUT
/
users
curl --request PUT \
  --url https://api.contextual.ai/v1/users \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "<string>",
  "is_tenant_admin": false,
  "roles": [
    "AGENT_USER"
  ],
  "per_agent_roles": [
    {
      "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "roles": [
        "AGENT_USER"
      ],
      "grant": true
    }
  ]
}'
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The schema used for creating new users or updating existing users. Need to keep in sync with frontend/src/types/admin.ts.

email
string
required

The email of the user

is_tenant_admin
boolean
default:false

Flag indicating if the user is a tenant admin

roles
enum<string>[]

The user level roles of the user.

Available options:
AGENT_USER
per_agent_roles
object[]

Per agent level roles for the user. If a user is granted any role under roles, then the user has that role for all the agents. Only the roles that need to be updated should be part of this.

The schema used to capture agent level roles

Response

200
application/json
Successful Response

The response is of type object.