---
title: "Invite Users"
method: POST
path: "/users"
tags: ["/users"]
---

# Invite Users

`POST /users`

Invite users to the tenant. This checks if the user is already in the tenant and if not, creates the user. We will return a list of user emails that were successfully created (including existing users).

## Request body

- InviteUsersRequest
  - `tenant_short_name` string, required — The short name of the tenant
  - `new_users` TenantNewUserInfo[], required — List of new users to be invited
    - `email` string, required — The email of the user
    - `is_tenant_admin` boolean — Flag indicating if the user is a tenant admin
    - `roles` UserRolesEnum[] — The user level roles of the user.
    - `agent_level_roles` AgentLevelUserRolesEnum[] — The user level roles of the user for agent level roles.
    - `per_agent_roles` PerAgentRoles[] — Per agent level roles for the user. If a user is granted any role under `agent_level_roles`, then the user has that role for all the agents. Only the roles that need to be updated should be part of this.
      - `agent_id` string, uuid, required — ID of the agent on which to grant/revoke the role.
      - `roles` AgentLevelUserRolesEnum[], required — The roles that are granted/revoked
      - `grant` boolean, required — When set to true, the roles will be granted o/w revoked.

## Response `200`

Successful Response

- InviteUsersResponse
  - `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

## Other responses

- `422` — Validation Error

## Changes

- **2025-10-28** `c8152db45500` — 3 info
  - added the new `CONTEXTUAL_ADMIN` enum value to the request property `new_users/items/roles/items/`
  - added the new `CUSTOMER_ADMIN` enum value to the request property `new_users/items/roles/items/`
  - added the new `CUSTOMER_USER` enum value to the request property `new_users/items/roles/items/`
- **2025-08-26** `db7245c74772` — 3 info
  - added the new optional request property `new_users/items/agent_level_roles`
  - added the new optional request property `new_users/items/per_agent_roles`
  - added the new `SERVICE_ACCOUNT` enum value to the request property `new_users/items/roles/items/`
- **2025-05-08** `17bdb8a33fb4` — 1 warning, 7 info
  - removed the request property `new_users/items/per_agent_roles`
  - added the new `CONTEXTUAL_EXTERNAL_STAFF_USER` enum value to the request property `new_users/items/roles/items/`
  - added the new `CONTEXTUAL_INTERNAL_STAFF_USER` enum value to the request property `new_users/items/roles/items/`
  - added the new `CONTEXTUAL_STAFF_USER` enum value to the request property `new_users/items/roles/items/`
  - …4 more
- **2025-02-08** `d79ccb778953` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/contextualai/apis/endpoints/changes/users/post.md)

---

[API](https://skmtc.dev/contextualai/apis/endpoints.md) · [All operations](https://skmtc.dev/contextualai/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/contextualai/endpoints/revisions/ca7f807eec8b/schema)
