---
descriptions:
  update_user:
    first_name: The user’s first name.
    last_name: The user’s last name.
    email: >
      The user’s email address.


      Changing a user's email will set `email_verified` to false.
      [Identities](/reference/authkit/identity) that do not match the new email
      will be unlinked.
    email_verified: >
      Whether the user’s email address was previously verified.


      You should normally use the [email verification
      flow](/reference/authkit/authentication/email-verification)

      to verify a user’s email address. However, if the user’s email was
      previously verified, or

      is being migrated from an existing user store, this can be set to `true`
      to mark it as

      already verified.
    metadata: >-
      Object containing [metadata](/authkit/metadata) key/value pairs associated
      with the user.
    external_id: >-
      The [external identifier](/authkit/metadata/external-identifiers) of the
      user.
reference:
  curl:
    - key: update_user
      id: update_user
      url: /reference/authkit/user/update
      title: '/user_management/users/:id'
      type: PUT
      parameters:
        - (user.id)
        - key: first_name
          type: string
          optional: true
          description: (update_user.first_name)
        - key: last_name
          type: string
          optional: true
          description: (update_user.last_name)
        - key: email
          type: string
          optional: true
          description: (update_user.email)
        - key: email_verified
          type: boolean
          optional: true
          description: (update_user.email_verified)
        - key: password
          type: string
          optional: true
          description: (create_user.password)
        - key: password_hash
          type: string
          optional: true
          description: (create_user.password_hash)
        - key: password_hash_type
          type: string
          optional: true
          description: (create_user.password_hash_type)
        - key: external_id
          type: string
          optional: true
          description: (update_user.external_id)
        - key: metadata
          type: object
          optional: true
          description: (update_user.metadata)
        - key: locale
          type: string
          optional: true
          description: (user.locale)
      returns:
        - (user)
  js:
    - key: updateUser
      id: update_user
      url: /reference/authkit/user/update
      title: userManagement.updateUser()
      parameters:
        - key: userId
          type: string
          description: (user.id)
        - key: firstName
          type: string
          optional: true
          description: (update_user.first_name)
        - key: lastName
          type: string
          optional: true
          description: (update_user.last_name)
        - key: email
          type: string
          optional: true
          description: (update_user.email)
        - key: emailVerified
          type: boolean
          optional: true
          description: (update_user.email_verified)
        - key: password
          type: string
          optional: true
          description: (create_user.password)
        - key: passwordHash
          type: string
          optional: true
          description: (create_user.password_hash)
        - key: passwordHashType
          type: string
          optional: true
          description: (create_user.password_hash_type)
        - key: externalId
          type: string
          optional: true
          description: (update_user.external_id)
        - key: metadata
          type: object
          optional: true
          description: (update_user.metadata)
      returns:
        - (User)
  php:
    - key: updateUser
      id: update_user
      url: /reference/authkit/user/update
      title: $userManagement->updateUser()
      parameters:
        - key: id
          type: string
          description: (user.id)
        - key: firstName
          type: string
          optional: true
          description: (update_user.first_name)
        - key: lastName
          type: string
          optional: true
          description: (update_user.last_name)
        - key: email
          type: string
          optional: true
          description: (update_user.email)
        - key: emailVerified
          type: boolean
          optional: true
          description: (update_user.email_verified)
        - key: password
          type: string
          optional: true
          description: (create_user.password)
        - key: passwordHash
          type: string
          optional: true
          description: (create_user.password_hash)
        - key: passwordHashType
          type: string
          optional: true
          description: (create_user.password_hash_type)
      returns:
        - (User)
  go:
    - key: UpdateUser
      id: update_user
      url: /reference/authkit/user/update
      title: usermanagement.UpdateUser()
      parameters:
        - (ctx)
        - key: opts
          type: usermanagement.UpdateUserOpts
          unwrap: true
          properties:
            - key: User
              type: string
              description: (user.id)
            - key: FirstName
              type: string
              optional: true
              description: (update_user.first_name)
            - key: LastName
              type: string
              optional: true
              description: (update_user.last_name)
            - key: Email
              type: string
              optional: true
              description: (update_user.email)
            - key: EmailVerified
              type: boolean
              optional: true
              description: (update_user.email_verified)
            - key: Password
              type: string
              optional: true
              description: (create_user.password)
            - key: PasswordHash
              type: string
              optional: true
              description: (create_user.password_hash)
            - key: PasswordHashType
              type: string
              optional: true
              description: (create_user.password_hash_type)
            - key: ExternalID
              type: string
              optional: true
              description: (update_user.external_id)
            - key: Metadata
              type: 'map[string]string'
              optional: true
              description: (update_user.metadata)
      returns:
        - key: user
          type: usermanagement.User
          description: (user.self)
        - (err)
  python:
    - key: update_user
      id: update_user
      url: /reference/authkit/user/update
      title: user_management.update_user()
      parameters:
        - key: user_id
          type: str
          description: (user.id)
        - key: first_name
          type: str
          optional: true
          description: (update_user.first_name)
        - key: last_name
          type: str
          optional: true
          description: (update_user.last_name)
        - key: email
          type: str
          optional: true
          description: (update_user.email)
        - key: email_verified
          type: bool
          optional: true
          description: (update_user.email_verified)
        - key: password
          type: str
          optional: true
          description: (create_user.password)
        - key: password_hash
          type: str
          optional: true
          description: (create_user.password_hash)
        - key: password_hash_type
          type: PasswordHashType
          optional: true
          description: (create_user.password_hash_type)
        - key: external_id
          type: str
          optional: true
          description: (update_user.external_id)
        - key: metadata
          type: 'Dict[str, str]'
          optional: true
          description: (update_user.metadata)
      returns:
        - (User)
  ruby:
    - key: update_user
      id: update_user
      url: /reference/authkit/user/update
      title: UserManagement.update_user()
      parameters:
        - key: id
          type: String
          description: (user.id)
        - key: first_name
          type: String
          optional: true
          description: (update_user.first_name)
        - key: last_name
          type: String
          optional: true
          description: (update_user.last_name)
        - key: email
          type: String
          optional: true
          description: (update_user.email)
        - key: email_verified
          type: Boolean
          optional: true
          description: (update_user.email_verified)
        - key: password
          type: String
          optional: true
          description: (create_user.password)
        - key: password_hash
          type: String
          optional: true
          description: (create_user.password_hash)
        - key: password_hash_type
          type: String
          optional: true
          description: (create_user.password_hash_type)
        - key: external_id
          type: str
          optional: true
          description: (update_user.external_id)
      returns:
        - (User)
  java:
    - key: updateUser
      id: update_user
      url: /reference/authkit/user/update
      title: userManagement.updateUser()
      parameters:
        - key: userId
          type: String
          description: (user.id)
        - key: options
          type: UpdateUserOptions
          unwrap: true
          properties:
            - key: id
              type: String
              description: (user.id)
            - key: firstName
              type: String
              optional: true
              description: (update_user.first_name)
            - key: lastName
              type: String
              optional: true
              description: (update_user.last_name)
            - key: emailVerified
              type: Boolean
              optional: true
              description: (update_user.email_verified)
            - key: password
              type: String
              optional: true
              description: (create_user.password)
            - key: passwordHash
              type: String
              optional: true
              description: (create_user.password_hash)
            - key: passwordHashType
              type: PasswordHashTypeEnumType
              optional: true
              description: (create_user.password_hash_type)
      returns:
        - (User)
originalPath: .tmp-workos-clone/packages/docs/content/reference/authkit/user/update.mdx
---

## Update a user

Updates properties of a user. The omitted properties will be left unchanged.

<CodeBlock referenceId="update_user">
  <CodeBlockTab title="Request" file="update-user-request" />
  <CodeBlockTab title="Response" file="update-user-response" />
</CodeBlock>
