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

# Create a user



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json post /v1/users
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/users:
    post:
      tags:
        - User
      summary: Create a user
      operationId: user.store
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserStoreRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/UserResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UserStoreRequest:
      type: object
      properties:
        name:
          type: string
          description: User's name.
          maxLength: 255
        email:
          type: string
          format: email
          description: User's email address.
          maxLength: 255
        password:
          type: string
          description: User's password.
          minLength: 8
        password_confirmation:
          type: string
          description: User's password confirmation. Must match the password field.
          minLength: 8
        phone:
          type:
            - string
            - 'null'
          description: User's phone number.
          maxLength: 20
        title:
          type:
            - string
            - 'null'
          description: User's title.
          maxLength: 255
        emergency_contact_name:
          type:
            - string
            - 'null'
          description: User's emergency contact name.
          maxLength: 255
        emergency_contact_surname:
          type:
            - string
            - 'null'
          description: User's emergency contact surname.
          maxLength: 255
        emergency_contact_phone_number:
          type:
            - string
            - 'null'
          description: User's emergency contact phone number.
          maxLength: 20
        blood_group:
          type:
            - string
            - 'null'
          description: User's blood group.
          maxLength: 10
        language:
          type:
            - array
            - 'null'
          description: User's language preferences.
          items:
            type: string
        avatar_url:
          type:
            - string
            - 'null'
          description: User's avatar URL.
          maxLength: 1000
        is_active:
          type:
            - boolean
            - 'null'
          description: User's active status.
        bio:
          type:
            - string
            - 'null'
          description: User's bio.
          maxLength: 1000
        role_ids:
          type:
            - array
            - 'null'
          description: Role identifiers to assign to user.
          items:
            type: integer
            description: A role ID.
      required:
        - name
        - email
        - password
        - password_confirmation
      title: UserStoreRequest
    UserResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
        title:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
        emergency_contact_name:
          type:
            - string
            - 'null'
        emergency_contact_surname:
          type:
            - string
            - 'null'
        emergency_contact_phone_number:
          type:
            - string
            - 'null'
        blood_group:
          type:
            - string
            - 'null'
        language:
          type:
            - array
            - 'null'
          items: {}
        avatar_url:
          type:
            - string
            - 'null'
        is_active:
          type: boolean
        bio:
          type:
            - string
            - 'null'
        last_login_at:
          type:
            - string
            - 'null'
          format: date-time
        last_login_ip:
          type:
            - string
            - 'null'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/RelatedRoleResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - name
        - email
        - title
        - phone
        - emergency_contact_name
        - emergency_contact_surname
        - emergency_contact_phone_number
        - blood_group
        - language
        - avatar_url
        - is_active
        - bio
        - last_login_at
        - last_login_ip
        - created_at
        - updated_at
        - deleted_at
      title: UserResource
    RelatedRoleResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      title: RelatedRoleResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````