---     
tags: 
  - Users
description: Updates a user. All fields in the body are optional (if not included, the field will be unchanged), but `sha3_pass` and `sha3_salt` must always appear together.
parameters:
  - in: header
    name: Authorization
    type: string
    required: true
  - in: body
    name: body
    type: object
    required: true
    schema:
      example: {
        "user_name": "New User",
        "email": "newuser@satsense.com",
        "role": 1,
        "phone": "09876 54321",
        "expiry_date": "20240730",
        "map_start": [1,2,3],
        "sha3_pass": "3421e2f052017496b4e09309bac74e58e4eb8ee6eb6068688e6ac417d0b846cfb4730605d33396f49970db3bb52c4c1bee8f2d4668ee284592b35350f50d64a9",
        "sha3_salt": "207e619e6b0141e4",
        "portal_layers": ["asc", "desc"],
      } 
produces: 
  - 'application/json'
responses:
  200:
    schema:
      type: object
      example: {
          "message": "update successful"
      }
  400:
    schema:
      type: object
      example: {
        "message": "invalid portal layer"
      }
  401:
    schema:
      type: object
      properties:
        error:
          type: string
          example: 'Unauthorised'
  409:
    schema:
      type: object
      example: {
        "message": "user with email already exists",
        "id": 17
      }

