Update a User
Update a user given their userId
.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Update Object endpoint instead.
Endpoint
PUT /v1/users/:userId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | The id of the user to update. Note that id cannot be changed. | URL param | yes |
email | The email of the user. | JSON body | no |
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/users/d6ed6474-784e-407e-a1ea-42a91d4c52b9" \
-X PUT \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{ "email": "updated@email.com" }'
updatedUser, err := user.Update("d6ed6474-784e-407e-a1ea-42a91d4c52b9", &warrant.UserParams{
Meta: map[string]interface{}{
"email": "updated@email.com",
},
})
Map<String, Object> userMeta = new HashMap<String, Object>();
userMeta.put("email", "updated@email.com");
User updatedUser = client.updateUser("d6ed6474-784e-407e-a1ea-42a91d4c52b9", new User("d6ed6474-784e-407e-a1ea-42a91d4c52b9", userMeta));
const updatedUser = await warrantClient.User.update(
"d6ed6474-784e-407e-a1ea-42a91d4c52b9",
{ email: "updated@email.com" }
);
user = warrant.User.get("d6ed6474-784e-407e-a1ea-42a91d4c52b9")
user.update({"email": "updated@email.com"})
updated_user = Warrant::User.update("d6ed6474-784e-407e-a1ea-42a91d4c52b9", { email: "updated@email.com" })
$updated_user = $warrant->updateUser("d6ed6474-784e-407e-a1ea-42a91d4c52b9", new \Warrant\User(email:"updated@email.com"));
Response
{
"userId": "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
"email": "updated@email.com"
}