---
title: "Update a user"
method: POST
path: "/users/{userId}/"
tags: ["Organizations"]
---

# Update a user

`POST /users/{userId}/`

## Request

- Base URL: `https://dashboard.hologram.io/api/1`
- URL: `https://dashboard.hologram.io/api/1/users/{userId}/`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/hologram/apis/hologram-rest-api-v1/docs/users/:userId/post.ts> (a function with typed inputs; its response is checked against the schema)

For users with a Cognito account, a new email isn't saved right away: Cognito emails a verification code to it, the response includes `email_status: CONFIRM_PENDING`, and the change is saved once the code is submitted to `POST /users/me/email/confirm/`. The current email stays active until then. Only the account owner can change the email of a user with a Cognito account. Admins can still change names. For users still on the legacy login system, the new email is saved immediately, a notice is sent to the old address, and a verification email is sent to the new one.

## Path parameters

- `userId` integer, required

## Request body

- object
  - `first` string: User's first name
  - `last` string: User's last name
  - `email` string, email: User's email address

## Response `200`

OK

- UserResponse
  - `success` boolean: Indicates whether the request was successful.
  - `data` UserObject
    - `id` integer
    - `email` string, email
    - `first` string
    - `last` string
    - `role` string
    - `partnerid` integer
    - `registered` string, date-time
    - `is_verified` 0 | 1
    - `has_password` 0 | 1
    - `defaultaddressid` integer, nullable
    - `deleted` 0 | 1
    - `personal_org` integer, nullable: Personal organization ID; present on single-user responses
    - `impersonated_by` object, nullable: Present when the current session is being impersonated
    - `email_status` 'CONFIRM_PENDING': Present on update responses while an email change awaits confirmation

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden, including changing the email of a Cognito user other than yourself
- `409`: Email address is already in use (Cognito users, error_code EMAIL_UNAVAILABLE)
- `429`: Too many verification emails requested (error_code TOO_MANY_ATTEMPTS)
- `500`: Cognito error (error_code COGNITO_ERROR)

---

[API](https://skmtc.dev/hologram/apis/hologram-rest-api-v1.md) - [All operations](https://skmtc.dev/hologram/apis/hologram-rest-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/hologram/apis/hologram-rest-api-v1/revisions/1bc07dcd1631?raw)
