---
title: "Modify User."
method: PATCH
path: "/_api/user/{user}"
tags: ["Users"]
---

# Modify User.

`PATCH /_api/user/{user}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/user/:user/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update the data of an existing user.

**Note**: Requires *administrator* permissions if changing the email address.

## Path parameters

- `user` string, string, required

## Request body

- UserModify
  - `active` boolean: If set to _true_, then the user is active.
  - `passwd` string: The user password. The password must have at least 8 characters, one uppercase letter, one lowercase letter, one number, and one special character (!@#$%^&*).
  - `displayName` string: The user name.
  - `newEmail` object: User's email. Requires *administrator* permissions.
    - `email` string, required: The user email.
    - `isVerified` boolean, required: If *true*, new email has been verified and can be updated in database.

## Response `200`

Successfully modified user.

- ApiKeyHttpExamplesRc2000
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False*for this response.
  - `tenant` string: The name of the tenant.
  - `user` string: The id of the user.
  - `displayName` string: The username of the tenant.
  - `email` string: The email of this API key.
  - `active` boolean: Active status the API key.
  - `apikey` object: Hash of API key.
    - `hash` string: Hash of API key.
    - `parent` string: Hash of API key.
  - `extra` object: A JSON object with extra user information.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed to validate because you do not have access to the GeoFabric.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified user

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
