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

# Update user

> This endpoint lets you update a user. You need to have `WRITE` access to this user. It has a patch behaviour which means that only indicated value will be changed.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /user/{user_id}
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /user/{user_id}:
    post:
      tags:
        - Users
      summary: Update user
      description: >
        This endpoint lets you update a user. You need to have `WRITE` access to
        this user. It has a patch behaviour which means that only indicated
        value will be changed.
      operationId: updateUser
      parameters:
        - $ref: '#/components/parameters/path_user_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: Request body to update a user.
              type: object
              properties:
                email:
                  $ref: '#/components/schemas/UserEmail'
                first_name:
                  $ref: '#/components/schemas/UserFirstName'
                last_name:
                  $ref: '#/components/schemas/UserLastName'
                org_id:
                  $ref: '#/components/schemas/UserCreateUpdateOrgId'
                accesses:
                  $ref: '#/components/schemas/accesses'
                business_ids:
                  description: >
                    The list of business to which the user has access to. Will
                    be taken into account only if user has `BUSINESS_MANAGER`
                    role.
                  type: array
                  items:
                    type: string
                role:
                  $ref: '#/components/schemas/RoleWithoutProvider'
                custom_role:
                  $ref: '#/components/schemas/CustomRoleApiId'
                sidebar_pages:
                  deprecated: true
                  allOf:
                    - $ref: '#/components/schemas/SidebarPages'
                  description: >
                    **DEPRECATED**: This parameter is deprecated in favor of the
                    new Custom Roles system. See the [Custom Roles & Permissions
                    guide](/guides/api/guides/custom-roles-and-permissions) for
                    migration information.


                    List of features the user can access from the sidebar.
                status:
                  $ref: '#/components/schemas/UserStatus'
                disabled:
                  type: boolean
                  description: The state of the User account.
                password:
                  $ref: '#/components/schemas/Password'
                lang:
                  $ref: '#/components/schemas/Lang'
                sso_only:
                  $ref: '#/components/schemas/SsoOnly'
                receive_reviews_email_notifications:
                  description: >-
                    The parameter decides if the user subscribes to negative
                    reviews email notifications
                  type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    $ref: '#/components/schemas/UserId'
                  status:
                    type: string
                    enum:
                      - success
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    path_user_id:
      in: path
      required: true
      name: user_id
      schema:
        type: string
      description: User id
  schemas:
    UserEmail:
      description: User email
      type: string
      format: email
      example: perceval@kaamelott.com
    UserFirstName:
      description: User first name
      type: string
      example: Perceval
    UserLastName:
      description: User last name
      type: string
      example: de Galles
    UserCreateUpdateOrgId:
      description: >
        Unique identifier of the organization to which the user should belong.
        Only `PROVIDER` users can set this field. If no `org_id` is given, or if
        you are not a `PROVIDER`, the user will have the same organization as
        you.
      type: integer
      example: 42
    accesses:
      description: >
        List of (list of Group ID).


        Accesses of the users for the new groups system, only for
        `GROUP_MANAGER` users.


        See [the Groups and Sections
        description](/guides/api/resources/organizations/groups)
      type: array
      items:
        type: array
        items:
          type: integer
      example:
        - - 1
          - 2
        - - 1
          - 3
    RoleWithoutProvider:
      description: User role in the application
      type: string
      enum:
        - ORG_ADMIN
        - ORG_MANAGER
        - GROUP_MANAGER
        - BUSINESS_MANAGER
        - PUBLISHER
      example: BUSINESS_MANAGER
    CustomRoleApiId:
      description: >
        Optional API identifier of a custom role to assign to the user. The
        value must match the `api_id` of one of the custom roles available to
        your organization.


        If no custom role is given, users with the role `GROUP_MANAGER` or
        `BUSINESS_MANAGER` will automatically be assigned to the default
        built-in custom role associated with their role.


        For more information about custom roles, see [Managing User Permissions
        with Custom Roles](/guides/api/guides/custom-roles-and-permissions)
      type: string
      example: my_custom_role
    SidebarPages:
      type: array
      description: |
        List of features the user can access from the sidebar.
      items:
        allOf:
          - $ref: '#/components/schemas/SidebarPagesFeatureEnum'
        type: string
        description: Sidebar page feature name
    UserStatus:
      description: User status in the application
      type: string
      enum:
        - active
        - invited
      example: active
    Password:
      description: |
        The User password. It should comply with the following rules:
        - should be at least 8 characters long
        - should have one upper case letter and one lower case letter
        - should have one special character
      type: string
      format: password
      minLength: 8
    Lang:
      description: Available language in the application
      type: string
      enum:
        - fr
        - en
        - es
        - it
        - pt-br
        - de
        - ar
        - nl
        - pl
        - cs
        - ca
        - sk
        - pt
        - lv
        - ro
        - bg
        - hu
      example: fr
    SsoOnly:
      description: >
        Prevent the user from connecting directly from the Partoo connection
        page.


        This field is available for users whose organization has defined an SSO
        configuration.


        This field can be edited by a user with the role `ORG_ADMIN` or
        `PROVIDER`.
      type: boolean
      default: false
    UserId:
      description: User id
      type: string
      example: 5309c3a237bbc544d8e26737
    SidebarPagesFeatureEnum:
      enum:
        - bulk_modification
        - diffusion
        - feedback_management
        - messages
        - posts
        - presence_analytics
        - review_analytics
        - review_invite
        - review_management
  responses:
    '400':
      description: Your request is incorrect
      content:
        application/json:
          schema:
            description: |
              Error that occcurs when your request is incorrect
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: object
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
    '404':
      description: Resource does not exist
      content:
        application/json:
          schema:
            description: >-
              Error that occcurs when you are trying to reach a resource that
              does not exist
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: string
                    default: Resource not found
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````