Edit a user: Migration guide
This guide outlines the changes introduced in the Edit a user v2 endpoint (previously known as updateUser in v1).
Key changesThe v2 version of this endpoint introduces a change in the HTTP method used:
- HTTP method: The v2 endpoint uses the PATCH method, while v1 used the PUT method.
Documentation links
Here are the links to the API reference for:
Endpoint mapping
Here's the direct correlation between the v1 and v2 endpoint URLs:
- API v1:
/api/v1/users/{​user_email​} - API v2:
/api/v2/users/{​userId​}
Input changes
This section details the specific alterations to the input requirements between API versions.
API v1 input example
curl --location -g --request PUT 'http://app.360learning.com/api/v1/users/5b56f4c392af558eb5f1386c?company={{company}}&apiKey={{apiKey}}' \
--header 'Content-Type: application/json' \
--data '{
"firstName": "John"
}'API v2 input example
curl --request PATCH \
--url https://app.360learning.com/api/v2/users/507f1f77bcf86cd799439011 \
--header '360-api-version: v2.0' \
--header 'accept: application/json' \
--header 'authorization: Bearer access_token' \
--header 'content-type: application/json' \
--data '
{
"firstName": "John",
"lastName": "Smith",
"phone": "+33123456789",
"job": "Boss",
"organization": "360Learning",
"custom": "Half-time worker",
"lang": "en",
"mail": "[email protected]",
"username": "johnsmith"
}
'Main input differences
API v2 fosters streamlined data exchanges, focusing on the essential properties of a user. Thus it's not possible anymore to update a user's custom fields through this call. For this you'll have to use the Replace a user custom fields values endpoint.
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| Use the endpoint Add a user's role and Remove a user's role to update the membership of a user. |
Removed |
| Use the endpoint Replace the password of a user to update a user's password. |
Added |
| |
Added |
|
Output changes
Output is completely changed to follow RESTful principles. Instead of returning an acknowledgment of the user update, we now return the updated user object.
API v1 output example
{
"status": "user_updated"
}API v2 output example
{
"_id": "507f1f77bcf86cd799439011",
"mail": "[email protected]",
"username": "johnsmith",
"deleted": true,
"lang": "bg",
"firstName": "John",
"lastName": "Smith",
"job": "Engineer",
"organization": "360Learning",
"phone": "+33123456789",
"custom": "Half-time worker",
"deletedAt": [
"2025-06-06T13:21:38.271Z"
],
"reactivatedAt": [
"2025-06-06T13:21:38.271Z"
],
"lastLoginDate": "2025-06-06T13:21:38.271Z",
"toBeDeactivatedAt": "2025-06-06T13:21:38.271Z"
}Main output differences
As shown in the example above, response is completely different, so please refer to the Retrieve a user: Migration guide for more information.
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| |
Removed |
| |
Removed |
| |
Removed |
| |
Removed |
| |
Added |
| |
Added |
| |
Added |
| |
Added |
| |
Added |
| |
Added |
|
Updated 7 days ago
