> ## Documentation Index
> Fetch the complete documentation index at: https://kaneo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a user

> Create an account with an instance role. No password is set or returned. When password sign-in is available, the user is emailed a single-use link, valid for 2 days, to choose their own password. When password registration or the login form is disabled, the account is created with a verified email so the user can sign in with single sign-on, and no email is sent. Registration restrictions do not apply to administrators. Requires the `users:create` instance permission; API keys are rejected.



## OpenAPI

````yaml /openapi.json post /admin/users
openapi: 3.1.0
info:
  title: Kaneo API
  version: 1.0.0
  description: Kaneo Project Management API - Manage projects, tasks, labels, and more
servers:
  - url: https://cloud.kaneo.app/api
    description: Kaneo API Server
security:
  - bearerAuth: []
paths:
  /admin/users:
    post:
      tags:
        - Admin
      summary: Create a user
      description: >-
        Create an account with an instance role. No password is set or returned.
        When password sign-in is available, the user is emailed a single-use
        link, valid for 2 days, to choose their own password. When password
        registration or the login form is disabled, the account is created with
        a verified email so the user can sign in with single sign-on, and no
        email is sent. Registration restrictions do not apply to administrators.
        Requires the `users:create` instance permission; API keys are rejected.
      operationId: createAdminUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                email:
                  type: string
                  maxLength: 254
                  format: email
                  description: >-
                    The new user's email address. They sign in with it and
                    receive their password link there.
                role:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    Instance role, as for updates. Defaults to the instance's
                    default role for new users.
              required:
                - name
                - email
      responses:
        '201':
          description: The new user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedAdminUser'
        '400':
          description: Invalid name, email, or role, or a disposable address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            The caller lacks the instance permission or is authenticated with an
            API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: A user with this email already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          $ref: '#/components/responses/ApiKeyRateLimited'
components:
  schemas:
    CreatedAdminUser:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/AdminUser'
        passwordSetupEmail:
          type: string
          enum:
            - sent
            - failed
            - not_configured
            - not_needed
          description: >-
            Whether the link to choose a password was emailed: `not_configured`
            without SMTP, `not_needed` when the account is for single sign-on.
            The link itself is never returned.
      required:
        - user
        - passwordSetupEmail
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of the error.
          example: Task not found
        code:
          type: string
          description: >-
            Stable UPPER_SNAKE_CASE code. Derived from the status unless a more
            specific code applies, such as VALIDATION_ERROR or
            MISSING_PERMISSION.
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: >-
                  Dotted path to the invalid input, prefixed with the request
                  part (body, query, params, header).
                example: body.title
              message:
                type: string
                example: Required
            required:
              - path
              - message
          description: Every validation issue, for VALIDATION_ERROR.
        missingPermissions:
          type: array
          items:
            type: string
          description: >-
            Permissions the caller lacks for this route, as resource:action, for
            MISSING_PERMISSION and API_KEY_SCOPE.
          example:
            - task:update
      required:
        - message
        - code
    AdminUser:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        emailVerified:
          type: boolean
        isAnonymous:
          type: boolean
        image:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        role:
          type:
            - string
            - 'null'
        banned:
          type: boolean
        banReason:
          type:
            - string
            - 'null'
        banExpires:
          type:
            - string
            - 'null'
          format: date-time
        lastActiveAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When one of the user's current sessions was last refreshed; null
            without a session.
        signInMethods:
          type: array
          items:
            type: string
          description: >-
            Linked sign-in methods: `credential` (password), `github`, `google`,
            `discord`, or `custom` (OIDC).
      required:
        - id
        - name
        - email
        - emailVerified
        - isAnonymous
        - image
        - createdAt
        - updatedAt
        - role
        - banned
        - banReason
        - banExpires
        - lastActiveAt
        - signInMethods
  responses:
    ApiKeyRateLimited:
      description: >-
        The API key exceeded its rate limit or usage quota. Wait the number of
        seconds in Retry-After before retrying. The X-RateLimit headers are sent
        only when the rate limit was hit.
      headers:
        Retry-After:
          description: >-
            Seconds to wait before retrying. Omitted when an exhausted usage
            quota never refills.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests the API key may make per window.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix time in seconds when the current window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or session token (Bearer)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.