# PUT /api/v1/users/{user_id}

> Update user

- **Tag:** user
- **Operation ID:** `update_user_api_v1_users__user_id__put`

## Description

Update a user's profile information.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `user_id` (path, string, required)

## Request body

Schema: `UserUpdate`

- `first_name` (string) — Updated first name.
- `last_name` (string) — Updated last name.
- `photo_url` (string) — Updated photo URL.
- `onboarded` (boolean) — Mark onboarding complete.
- `props` (object) — Updated user properties.

## Responses

### 200 — Successful Response

Schema: `UserResponse`

- `email` (string · email · required) — User email address (unique identifier).
- `first_name` (string) — User's first name.
- `last_name` (string) — User's last name.
- `photo_url` (string) — URL to user's profile photo.
- `onboarded` (boolean) — Whether user has completed onboarding.
- `props` (object) — Additional user properties/settings.
- `id` (string · required) — User UUID.
- `created_at` (string · date-time · required) — Account creation timestamp.
- `updated_at` (string · date-time · required) — Last profile update timestamp.
- `firm_ids` (array · string) — Advisory firm UUIDs the user belongs to.
- `role` (Role) — User's role in a business (only included when filtering by business_id).

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/users/{user_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "first_name": "string",
  "last_name": "string",
  "photo_url": "string",
  "onboarded": false,
  "props": {}
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/users/{user_id}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "first_name": "string",
  "last_name": "string",
  "photo_url": "string",
  "onboarded": false,
  "props": {}
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "first_name": "string",
  "last_name": "string",
  "photo_url": "string",
  "onboarded": false,
  "props": {}
}

response = httpx.put("https://api.ondayzero.com/api/v1/users/{user_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/user/update-user
- OpenAPI slice: https://www.ondayzero.com/docs/reference/user/update-user/openapi.json
- Other endpoints in **user**: https://www.ondayzero.com/docs/reference/user
