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

Authorizations

Authorization
string
header
required

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

Body

application/json
tenant_short_name
string
required

The short name of the tenant

new_users
object[]
required

List of new users to be invited

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

Response

200
application/json
Successful Response
invited_user_emails
string[]
required

List of emails of the invited users

error_details
object
required

Details of the errors occurred while inviting users, where keys are the emails and values are the error messages