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

# Update partially user

> This endpoint allows you to update the details of a specific user in the system. and the data to be updated is provided in the request body



## OpenAPI

````yaml /openapi/public/openapi-setting.json patch /user
openapi: 3.0.0
info:
  title: MileApp API - Setting
  version: 3.0.0
  description: MileApp API Documentation - RESTful API for field operations management.
servers:
  - url: https://apiweb.mile.app/api/v3
security:
  - bearerAuth: []
tags:
  - name: User
    description: >-
      User data includes information contained within a user account, such as
      details that define a user's hub access and role within the system. Hub
      access determines the locations or areas of the application a user can
      access or the specific actions they can perform. User attributes consist
      of the user ID, name, email, and status.


      MileApp provides five predefined user roles, and you can create custom
      roles based on your organization's needs. The predefined roles are
      **Owner, Admin, Planner, and Field user**. A user can only hold one role
      at a time but can be granted access to multiple hubs.
  - name: Team
    description: >-
      This API allows you to manage teams. It serves as a tool to effectively
      manage and restrict user task assignments within your organization.


      **To see the details of team object, please follow [this
      link](#tag/team_model)**
  - name: Role
    description: >-
      This API enables you to retrieve a list of predefined roles and any custom
      roles associated with your account. By making a GET request to this API,
      you can obtain information about the available roles within the system.
      The predefined roles refer to a set of role types that are already defined
      by the system. In this particular case, the predefined roles include
      Finance, Owner, Planner, Admin, and Field User. Additionally, the API may
      also return any custom roles that have been created within your account.


      **To see the details of role object, please follow [this
      link](#tag/role_model)**
  - name: Hub
    description: >-
      In our system, a Hub is a fundamental entity within an organization,
      serving as the central point for managing various operational components.
      It acts as the parent structure for a wide range of resources and
      functionalities, including tasks, visits, users, vehicles, routing
      results, routing configurations, and data sources.


      **To see the details of hub object, please follow [this
      link](#tag/hub_model)**


      ## Conceptual Understanding of Hubs


      - **User Perspective:** For users, a Hub represents their headquarters or
      primary working area. It is where they carry out their daily activities
      and manage their tasks effectively. Each user interacts with the Hub to
      access resources and perform operations specific to their roles.


      - **Task Perspective:** From the perspective of task management, the Hub
      signifies the working area for tasks. It is the location where tasks are
      initiated, monitored, and completed. The Hub facilitates organization and
      efficiency in task execution.


      - **Routing Perspective:** In the context of routing and logistics, a Hub
      serves as a critical location for vehicles. It is where vehicles begin
      their routes, return after completing their journeys, and may make
      strategic stops along the way. The routing module relies on the Hub to
      optimize vehicle assignments and manage routes effectively.
  - name: App Integration
    description: >-
      This API allows you to manage Integration of enterprise app. Currently
      available for Azure.


      **To see the details of integration object, please follow [this
      link](#tag/app_integration_model)**
  - name: Plugin
    description: >-
      The Plugin API allows developers to create and manage custom add-ons
      within the Mile V3 platform. Plugins enable dynamic functionality through
      JavaScript resources and custom icons, allowing organizations to extend
      platform capabilities with custom features and integrations.


      **To see the details of plugin object, please follow [this
      link](#tag/plugin_model)**
paths:
  /user:
    patch:
      tags:
        - User
      summary: Update partially user
      description: >-
        This endpoint allows you to update the details of a specific user in the
        system. and the data to be updated is provided in the request body
      operationId: patch-user
      requestBody:
        $ref: '#/components/requestBodies/patchUserRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/patchusersuccess'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/patchuserfailed'
      deprecated: false
      security:
        - Authorization: []
components:
  requestBodies:
    patchUserRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/patchUserRequest'
      required: true
  schemas:
    patchusersuccess:
      title: patchusersuccess
      example:
        status: true
        message: Data has been updated successfully.
        property:
          _id: 65c1f4eeca7c4816d94587b7
          name: Example
          email: example@mile.app
          provider: web
          hubId: []
          organizationId: 65c1f4eeca7c4816d94587b2
          status: active
          lastLogin: '2024-06-18T03:54:47+00:00'
          roleId: 65c1f4eeca7c4816d94587b3
          activationCode: 5dc25a36e280ba34ef6dfe1f54dcb5d6
          onboardingStep: []
          teamId: []
          updatedTime: '2024-06-18T04:42:04+00:00'
          createdTime: '2024-02-06T08:59:26+00:00'
          phoneNumber: null
          dynamicVisitTime: []
      type: object
      properties:
        property:
          type: object
          description: object of user.
          additionalProperties: true
        status:
          type: boolean
          description: Status of response.
        message:
          type: object
          description: Message of response.
          additionalProperties: true
    patchuserfailed:
      title: patchuserfailed
      example:
        status: false
        message: Deleted data failed
        userId: 400
      type: object
      properties:
        status:
          type: boolean
        message:
          type: string
        userId:
          type: integer
          format: int32
    patchUserRequest:
      title: patchUserRequest
      example:
        name: your update name
      type: object
      properties:
        name:
          type: string
          description: 'The name of user. **Example**: `Jhon doe`'
        email:
          type: string
          description: |-
            The email of user.
             **Example**: `example@mile.app`
        phoneNumber:
          type: string
          description: |-
            The phone number of user.
             **Example**: `+628123456789`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````