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

# Create User

`POST /v1/admin/users`

## Request

- The document declares no server URL.
- Auth: HTTP bearer

## Request body

- CreateUserBody
  - `email` string, required: The user email.
  - `name` string, nullable: The user name.
  - `password` string, required: The user password.
  - `role_id` integer, required: The role ID.
  - `organization_id` integer, required: 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_id` integer, required: ID of the role assigned to the user.
  - `organization_id` integer, required: 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}|{name} not found.<br>Organization {organization_id}|{name} not found.
- `409`: User {email} already exists.
- `422`: Validation Error

## Changes

- **2026-09-29** `2f7a4a0aac8f`: 1 info
  - endpoint added
- **2026-09-29** `da70d9cd1957`: 1 breaking
  - api path removed without deprecation
- **2026-09-21** `5fdbd3614b8c`: 2 breaking, 1 warning, 2 info
  - the request property `organization_id` became required
  - request property `organization_id` list-of-types was narrowed by removing types `null` from media type `application/json`
  - the `name/anyOf[subschema #1]/` request property's maxLength was set to `254`
  - the response property `organization_id` became required for the status `201`
  - …1 more
- **2026-08-27** `1627e468291c`: 2 breaking, 1 warning, 1 info
  - added the new required request property `role_id`
  - removed the required property `role` from the response with the `201` status
  - removed the request property `role`
  - added the required property `role_id` to the response with the `201` status
- **2026-07-11** `0fd1d281f985`: 1 breaking, 2 warning, 2 info
  - the `password` request property's minLength was increased from `1` to `6`
  - removed the request property `organization`
  - removed the optional property `organization` from the response with the `201` status
  - added the new optional request property `organization_id`
  - …1 more

[Operation history](https://skmtc.dev/betagouv/apis/opengatellm/changes/v1/admin/users/post.md)

---

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