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

# Create a new user



## OpenAPI

````yaml api-reference/openapi.json post /api/user/register
openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://localhost:8080
    description: Generated server url
security: []
paths:
  /api/user/register:
    post:
      tags:
        - User
      summary: Create a new user
      operationId: register
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRegisterDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UserDTO'
components:
  schemas:
    UserRegisterDTO:
      required:
        - email
        - fullName
        - phoneNumber
      type: object
      properties:
        email:
          type: string
        password:
          type: string
        fullName:
          pattern: ^\p{Lu}\p{Ll}+(\p{Lu}\p{Ll}+)?( \p{Lu}\p{Ll}+(\p{Lu}\p{Ll}+)?)*$
          type: string
        phoneNumber:
          pattern: ^(\+84|0)( ?\d){9,10}$
          type: string
        street:
          type: string
        city:
          type: string
        province:
          type: string
        postalCode:
          type: string
        expertise:
          type: string
          enum:
            - apprentice
            - adept
            - expert
        role:
          type: string
          enum:
            - farmer
            - receptionist
            - sprayer
            - admin
        active:
          type: boolean
    UserDTO:
      type: object
      properties:
        id:
          type: integer
          format: int64
        email:
          type: string
        fullName:
          type: string
        phoneNumber:
          type: string
        street:
          type: string
        city:
          type: string
        province:
          type: string
        postalCode:
          type: string
        expertise:
          type: string
          enum:
            - apprentice
            - adept
            - expert
        role:
          type: string
          enum:
            - farmer
            - receptionist
            - sprayer
            - admin
        active:
          type: boolean

````