> ## 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.

# Update Account

> This endpoint updates the user's account by incrementing the user's balance

Endpoint: https://cashboard-f5x2.onrender.com/account/:id

Query Parameter: User UUID

Path Parameter: Account ID

The response body is a JSON object that contains the updated account details. Each account includes:

- name(string) - the name of the account
    
- desc(string) - a short description of the account
    
- currentAmount(number) - the account's balance
    
- _id(string) - the unique identifier for the account



## OpenAPI

````yaml put /account/{id}
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:
  /account/{id}:
    put:
      tags:
        - Account
      summary: Update Account
      description: >-
        This endpoint updates the user's account by incrementing the user's
        balance


        Endpoint: https://cashboard-f5x2.onrender.com/account/:id


        Query Parameter: User UUID


        Path Parameter: Account ID


        The response body is a JSON object that contains the updated account
        details. Each account includes:


        - name(string) - the name of the account
            
        - desc(string) - a short description of the account
            
        - currentAmount(number) - the account's balance
            
        - _id(string) - the unique identifier for the account
      parameters:
        - name: user
          in: query
          schema:
            type: string
          description: required
          example: '{{uuid}}'
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: required
          example: 662fbf9eac827e370c18d4b9
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                amount: 15000
      responses:
        '200':
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 16:32:28 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: 87c0b02f6fa51fd3-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"77-4QSuKVuNhTo0yBF7GKgdsxYEJUE"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: 25610a0c-796e-41b6
            x-powered-by:
              schema:
                type: string
                example: Express
            x-render-origin-server:
              schema:
                type: string
                example: Render
            Server:
              schema:
                type: string
                example: cloudflare
            Content-Encoding:
              schema:
                type: string
                example: br
            alt-svc:
              schema:
                type: string
                example: h3=":443"; ma=86400
          content:
            application/json:
              schema:
                type: object
              example:
                account:
                  name: KCB Account
                  desc: My checking account
                  currentAmount: 175000
                  _id: 662fbf9eac827e370c18d4b9
        '500':
          description: Internal Server Error
          headers:
            Date:
              schema:
                type: string
                example: Mon, 29 Apr 2024 16:33:19 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: 87c0b16eb85b1fe5-IAD
            CF-Cache-Status:
              schema:
                type: string
                example: DYNAMIC
            ETag:
              schema:
                type: string
                example: W/"32-ilIj8jJNz3lXF6aX2SEDBdeYguk"
            Vary:
              schema:
                type: string
                example: Origin, Accept-Encoding
            rndr-id:
              schema:
                type: string
                example: ad184e47-97ad-46f5
            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
              examples:
                example-0:
                  summary: Error
                  value:
                    status: error
                    message: Account not updated
                example-1:
                  summary: Error
                  value:
                    status: error
                    message: Account not updated

````