---
title: "Create User"
method: POST
path: "/v1/admin/users"
tags: ["Admin"]
---

# Create User

`POST /v1/admin/users`

## Request body

- CreateUserBody
  - `email` string, required — The user email.
  - `name` string, nullable — The user name.
  - `password` string, required — The user password.
  - `role` integer, required — The role ID.
  - `organization_id` integer, nullable — The organization ID.
  - `budget` number, nullable — The budget.
  - `expires` integer, nullable — The expiration timestamp.
  - `priority` integer — The user priority. Higher value means higher priority.

## Response `201`

Successful Response

- UserResponse
  - `object` 'user' — Type of the object.
  - `id` integer, required — ID of the user.
  - `email` string, required — Email of the user.
  - `name` string, nullable — Name of the user.
  - `sub` string, nullable — Subject identifier for SSO.
  - `iss` string, nullable — Issuer identifier for SSO.
  - `role` integer, required — ID of the role assigned to the user.
  - `organization_id` integer, nullable — ID of the organization the user belongs to.
  - `budget` number, nullable — Budget allocated to the user.
  - `expires` integer, nullable — Expiration time of the user, as Unix timestamp.
  - `created` integer, required — Time of creation, as Unix timestamp.
  - `updated` integer, required — Time of last update, as Unix timestamp.
  - `priority` integer, required — Priority of the user. Higher value means higher priority.

## Other responses

- `401` — Invalid authentication scheme.<br>Invalid API key.
- `403` — User has no admin rights.<br>Your account has expired. Please contact support to renew your account.
- `404` — Role {role_id} not found.<br>Organization {organization_id} not found.
- `409` — User {email} already exists.
- `422` — Validation Error

---

[API](https://skmtc.net/betagouv/apis/opengatellm.md) · [All operations](https://skmtc.net/betagouv/apis/opengatellm/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/betagouv/opengatellm/versions/f2624a610e5a/schema)
