> For the complete documentation index, see [llms.txt](https://docs.greenearth.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.greenearth.ai/api-endpoints/modify-user.md).

# Modify user

{% hint style="info" %}
[api-docs](https://api.greenearth.ai/api/api-docs) Redoc document (api spec)
{% endhint %}

{% openapi src="/files/Lii1IpL0WvkEW9nWVbfo" path="/api/user/{id\_or\_email}" method="put" %}
[openApi.json](https://1469186640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCU6kpEkHIZtR3Dw04saq%2Fuploads%2FuTfaJv07UDHnavZwOPFM%2FopenApi.json?alt=media\&token=20a01eda-5c56-4e35-a420-22c858ed9741)
{% endopenapi %}

This API endpoint allows updating a user's information by either their ID or email. The endpoint is "/api/user/{id\_or\_email}" where {id\_or\_email} is either the user's ID or email. This endpoint requires an API key with the "admin" permission for security.

The request must be in JSON format and contain the following parameters:

* user\_role: a string representing the user's role (example: "admin")
* user\_company: a string representing the user's company (example: "63c04c071ad80d5322929cb1")
* user\_company\_txn: a string representing the user's company transaction (example: "63c04c071ad80d5322929cb1")

The response is also in JSON format and contains two properties:

* error: an object containing error code and message (example: code: "040", message: "User not found")
* data: an object containing the updated user information including:
  * \_id: a string representing the user's ID (example: "MMGqKihnmmqyTgAy")
  * email: a string representing the user's email (example: "<test@gmail.com>")
  * password: a string representing the user's password
  * wallet: a string representing the user's wallet
  * user\_role: a string representing the user's role
  * user\_company: a string representing the user's company
  * user\_company\_txn: a string representing the user's company transaction
