# 

## Prerequisites

* A valid API key — see [Obtain API credentials](/docs/how-tos/setup/obtain-credentials)
* The `id` of the user to update (for example, `USER-3MtwBwLkdIwHu7ix28a3tqPa`)


## Updatable fields

| Field | Description |
|  --- | --- |
| `first_name` | User's first name |
| `last_name` | User's last name |
| `email` | Email address (also the login username) |
| `phone` | Phone number in E.164 format |
| `time_zone` | IANA time zone |


Partial updates
Include only the fields you want to change. Fields you omit are left unchanged.

## Step 1: Send the update request

Send `POST /v1/users/{id}` with the fields to change.

curl
```shell
curl -X POST \
  https://api.dev.paradisegateway.net/v1/users/USER-3MtwBwLkdIwHu7ix28a3tqPa \
  -H "Content-Type: application/json" \
  -H "APIKEY: YOUR-API-KEY" \
  -d '{
    "first_name": "Jonathan",
    "phone": "+15559999999",
    "time_zone": "America/Los_Angeles"
  }'
```

Python
```python
import requests

user_id = "USER-3MtwBwLkdIwHu7ix28a3tqPa"
resp = requests.post(
    f"https://api.dev.paradisegateway.net/v1/users/{user_id}",
    headers={"Content-Type": "application/json", "APIKEY": "YOUR-API-KEY"},
    json={
        "first_name": "Jonathan",
        "phone": "+15559999999",
        "time_zone": "America/Los_Angeles",
    },
)
print(resp.json())
```

JavaScript
```javascript
const userId = "USER-3MtwBwLkdIwHu7ix28a3tqPa";
const resp = await fetch(
  `https://api.dev.paradisegateway.net/v1/users/${userId}`,
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "APIKEY": "YOUR-API-KEY",
    },
    body: JSON.stringify({
      first_name: "Jonathan",
      phone: "+15559999999",
      time_zone: "America/Los_Angeles",
    }),
  }
);
console.log(await resp.json());
```

C#
```csharp
var userId = "USER-3MtwBwLkdIwHu7ix28a3tqPa";
var payload = new
{
    first_name = "Jonathan",
    phone = "+15559999999",
    time_zone = "America/Los_Angeles"
};
var resp = await client.PostAsJsonAsync(
    $"https://api.dev.paradisegateway.net/v1/users/{userId}", payload);
Console.WriteLine(await resp.Content.ReadAsStringAsync());
```

Java
```java
String userId = "USER-3MtwBwLkdIwHu7ix28a3tqPa";
String body = """
    {
      "first_name": "Jonathan",
      "phone": "+15559999999",
      "time_zone": "America/Los_Angeles"
    }
    """;
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create(
        "https://api.dev.paradisegateway.net/v1/users/" + userId))
    .header("Content-Type", "application/json")
    .header("APIKEY", "YOUR-API-KEY")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
HttpResponse<String> resp = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
```

Go
```go
userId := "USER-3MtwBwLkdIwHu7ix28a3tqPa"
payload := strings.NewReader(`{
  "first_name": "Jonathan",
  "phone": "+15559999999",
  "time_zone": "America/Los_Angeles"
}`)
req, _ := http.NewRequest("POST",
    "https://api.dev.paradisegateway.net/v1/users/"+userId, payload)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("APIKEY", "YOUR-API-KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
```

PHP
```php
$userId = "USER-3MtwBwLkdIwHu7ix28a3tqPa";
$ch = curl_init("https://api.dev.paradisegateway.net/v1/users/$userId");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "APIKEY: YOUR-API-KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "first_name" => "Jonathan",
        "phone" => "+15559999999",
        "time_zone" => "America/Los_Angeles",
    ]),
]);
echo curl_exec($ch); curl_close($ch);
```

Ruby
```ruby
require "net/http"; require "json"
user_id = "USER-3MtwBwLkdIwHu7ix28a3tqPa"
uri = URI("https://api.dev.paradisegateway.net/v1/users/#{user_id}")
req = Net::HTTP::Post.new(uri, {
  "Content-Type" => "application/json", "APIKEY" => "YOUR-API-KEY",
})
req.body = {
  first_name: "Jonathan", phone: "+15559999999",
  time_zone: "America/Los_Angeles",
}.to_json
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts resp.body
```

## Step 2: Verify the response

A `200` response returns the full, updated user object.

```json
{
  "id": "USER-3MtwBwLkdIwHu7ix28a3tqPa",
  "object": "user",
  "first_name": "Jonathan",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "phone": "+15559999999",
  "time_zone": "America/Los_Angeles",
  "is_mfa_active": false,
  "is_active": true,
  "is_locked": false,
  "correlation_id": "d4e5f6a7-b8c9-0123-def0-1234567890ab"
}
```

## Changing a user's email

Updating `email` also changes the user's login username. Coordinate with the user before making this change so they know to use the new email at next login.

Email uniqueness
Each email address must be unique across all users. The API returns a `400` error if the email is already in use.

## Next steps

* [Reset a user password](/docs/how-tos/clients-users/reset-password)
* [Enable MFA](/docs/how-tos/clients-users/enable-mfa)
* [About users and roles](/docs/concepts/account-hierarchy/users-and-roles)