---
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` RolesEnum[] — The user level roles of the user.
    - `per_agent_roles` PerAgentRoles[] — 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.
      - `agent_id` string, uuid, required — ID of the agent on which to grant/revoke the role.
      - `roles` RolesEnum[], 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-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/5298551c424b/schema)
