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

# Creating a new user

> This endpoint creates a new user.

The request body can include the following properties:

- username(string) - the user's username
- email(string) - the user's email
- password(string) - the user's password
- currency(string) - the user's preferred currency
    

The currency property is not required and defaults to "KSH" if not provided.

The response will be a JSON object that includes details of the query. The properties include:

- status(string) - indicates whether it was successful or not
    
- message(string) - provides details



## OpenAPI

````yaml post /user/add
openapi: 3.0.0
info:
  title: Cashboard API
  description: >-
    Cashboard is a personal finance tool that helps users keep track of their
    income, expenses, savings and investments.


    API URL: `https://cashboard-f5x2.onrender.com`


    The Cashboard API has endpoints for:


    - Users

    - Accounts

    - Income

    - Expenses

    - Savings

    - Investments
  version: 1.0.0
servers:
  - url: https://cashboard-f5x2.onrender.com
security: []
tags:
  - name: User
    description: |-
      Cashboard uses the users endpoint to:

      - create a new user
      - get a user details
      - update user details
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/user`
  - name: Account
    description: |-
      These endpoints are used to:

      - create account
      - get all user's accounts
      - get account
      - update accounts
      - delete accounts.
          

      The endpoint URL is: `https://cashboard-f5x2.onrender.com/account`
  - name: Income
    description: |-
      These endpoints are used to:

      - create an income source
      - get all income source
      - get an income source
      - update income source
      - delete income source
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/income`
  - name: Expenses
    description: |-
      These endpoints are used to:

      - create an expense
      - get all expenses
      - get an expense
      - update an expense
      - delete an expense
          

      The endpoint URL is: `https://cashboard-f5x2.onrender.com/expenses`
  - name: Savings
    description: |-
      These endpoints are used to:

      - create a saving
      - get all savings
      - get a saving
      - update a saving
      - delete a saving
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/savings`
  - name: Investments
    description: |-
      These endpoints are used to:

      - create an investment
          
      - get all investments
          
      - get an investment
          
      - update an investment
          
      - delete an investment
          

      The endpoint URL: `https://cashboard-f5x2.onrender.com/investments`
paths:
  /user/add:
    post:
      tags:
        - User
      summary: Creating a new user
      description: >-
        This endpoint creates a new user.


        The request body can include the following properties:


        - username(string) - the user's username

        - email(string) - the user's email

        - password(string) - the user's password

        - currency(string) - the user's preferred currency
            

        The currency property is not required and defaults to "KSH" if not
        provided.


        The response will be a JSON object that includes details of the query.
        The properties include:


        - status(string) - indicates whether it was successful or not
            
        - message(string) - provides details
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                username: michellemso
                email: michellemuthoni2@gmail.com
                password: Mso!254
      responses:
        '201':
          description: Created
          headers:
            X-Powered-By:
              schema:
                type: string
                example: Express
            Content-Type:
              schema:
                type: string
                example: application/json; charset=utf-8
            Content-Length:
              schema:
                type: integer
                example: '61'
            ETag:
              schema:
                type: string
                example: W/"3d-9C6pAihvSMniaN8KUU7pLe0Jlz0"
            Date:
              schema:
                type: string
                example: Mon, 12 Feb 2024 06:40:01 GMT
            Connection:
              schema:
                type: string
                example: keep-alive
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
          content:
            application/json:
              schema:
                type: object
              example:
                status: success
                message: A new user has been created!
        '500':
          description: Internal Server Error
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 16:07:41 GMT
            Content-Type:
              schema:
                type: string
                example: application/json; charset=utf-8
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Connection:
              schema:
                type: string
                example: keep-alive
            CF-Ray:
              schema:
                type: string
                example: 87c08be3488d6f9d-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"41-sxTD6YtiUZ8q4iDWuBWK8DFCRw0"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: c0e7ae9c-d8f8-46dd
            x-powered-by:
              schema:
                type: string
                example: Express
            x-render-origin-server:
              schema:
                type: string
                example: Render
            Server:
              schema:
                type: string
                example: cloudflare
            alt-svc:
              schema:
                type: string
                example: h3=":443"; ma=86400
          content:
            application/json:
              schema:
                type: object
              example:
                status: error
                message: User not created! Please try again

````