---
title: "Create a new user"
method: POST
path: "/v1/users"
tags: ["Users"]
---

# Create a new user

`POST /v1/users`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/users`
- Auth: OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Create a new user and add them to the organization.

## Request body

- CreateUser
  - `email` string, required: The email associated with the user.
  - `firstName` string, required: The first name of the user.
  - `lastName` string, required: The last name of the user.
  - `password` SecretApi, required: Secret wrapper for API responses
    - `secret` string, required: The secret value
  - `roleIds` string[], required: The roles associated with this user.

## Response `200`

User created successfully

- ReadUser
  - `email` string: The email associated with the user.
  - `id` string: The id associated with the user.
  - `name` string: The name of the user.
  - `roles` Role[], required: The roles associated with this user.
    - `builtin` boolean: Whether this is a built-in role
    - `createdAt` string, date-time: When the role was created (null for system roles)
    - `createdBy` string: Who created the role (null for system roles)
    - `description` string, required: Description of the role
    - `effect` string: The effect of this role's permissions: 'allow' or 'deny'. Defaults to 'allow' for standard roles.
    - `id` string, required: The id of the role.
    - `name` string, required: The user-facing name of the role.
    - `permissionIds` string[], required: Permission IDs assigned to this role (empty for system roles)
  - `teamIds` string[], required: The teams that this user is a member of.

## Other responses

- `400`: Invalid user data
- `401`: Unauthorized
- `403`: Unauthorized
- `409`: User already exists

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
