The PATCH /api/users/{userId}
endpoint allows for partially updating the information of a specific user. This method is useful when only a few fields need to be modified without sending all the user data. The user's identifier (userId
) is included in the request URL.
Request Details
- HTTP Method:
PATCH
- URL:
/api/users/{userId}
- Authentication: Requires a Bearer token.
- Request Format: JSON
Request Parameters
Field | Type | Required | Description |
---|---|---|---|
userId | string | Yes | The unique identifier of the user to be updated. |
Request Body Parameters
The request body must contain an array of patch operations to indicate the modifications to be made.
Request Body
Each patch operation in the request body must follow the format defined in the JSON Patch specification. A patch operation includes the following fields:
Field | Type | Required | Description |
---|---|---|---|
op | string | Yes | The operation to be performed, can be add , remove , replace , move , copy , or test . |
path | string | Yes | The path to the field to be modified, following JSON Pointer syntax. |
value | object | No | The new value for the field specified in path (required for add and replace ). |
Authentication Required
Example Request
PATCH /api/users/usr-12345 HTTP/1.1
Host: www.plaspy.com
Authorization: Bearer tu_token_de_autenticacion
Content-Type: application/json
[
{
"op": "replace",
"path": "/email",
"value": "nuevo_email@example.com"
},
{
"op": "add",
"path": "/tags",
"value": { "vip": "true" }
}
]
Response Parameters
Field | Type | Required | Description |
---|---|---|---|
success | boolean | No | Indicates if the operation was successful. |
error | string | No | Error message if the operation was not successful. |
apiUsage | integer | No | API usage for the current request. |
apiDailyUsage | integer | No | Daily API usage. |
id | string | No | Identifier of the updated user. |
name | string | No | Name of the user. |
string | No | Email of the user. | |
country | string | No | Country of the user. |
timeZone | string | No | Time zone of the user. |
description | string | No | Description of the user. |
message | string | No | Message associated with the user. |
disabled | boolean | No | Indicates if the user is disabled. |
tags | object | No | Tags associated with the user. |
privileges | array | No | Privileges of the user. |
group | string | No | Group to which the user belongs. |
deviceId | string | No | Identifier of the device associated with the user. |
adminDevices | integer | No | Number of devices managed by the user. |
from | string | No | Start date of the user's validity. |
expires | string | No | Expiration date of the user's validity. |
password | string | No | Password of the user. |
creation | string | No | Date the user was created. |
modification | string | No | Date the user was last modified. |
lastLogin | string | No | Date of the user's last login. |
Example Successful Response
{
"success": true,
"id": "usr-12345",
"name": "Juan Perez",
"email": "new_email@example.com",
"country": "Colombia",
"timeZone": "America/Bogota",
"description": "VIP User",
"tags": {
"vip": "true"
},
"privileges": ["read", "write"],
"group": "administrators",
"deviceId": "dev-67890",
"adminDevices": 5,
"from": "2023-01-01T00:00:00Z",
"expires": "2024-01-01T00:00:00Z",
"creation": "2022-01-01T00:00:00Z",
"modification": "2023-06-01T00:00:00Z",
"lastLogin": "2023-06-01T00:00:00Z"
}
Example Error Response
{
"success": false,
"error": "Invalid patch operation",
"apiUsage": 25,
"apiDailyUsage": 100
}
This endpoint facilitates updating specific data of a user, ensuring flexibility and efficiency in managing users within the Factory IL GPS system.
- Welcome to Factory IL GPS help
- Map
- Viewing a Device's Route History
- Device Control Panel
- Detailed Device Information
- Buttons on the Map
- Details
- Trip Statistics
- Device Menu
- GeoFences
- Bulk Alert Editing
- Enable map notifications
- Mileage Calculation
- Atributes
- Devices
- Marker Icon
- Information
- Sensors
- Reassign Digital Sensors
- Commands
- Alerts
- Types
- Configuration
- Reminders
- Limits
- History
- Setting Up a New Tracker
- Solution for Identifier Already in Use by Another Account
- Device Issues
- Email alerts sending limits
- Reports
- New Report
- My Account
- Password Change
- Email Notifications
- Telegram Accounts
- Update Mobile Phone Number
- Primary Email
- Alternative Email
- Activate Two-Factor Authentication (2FA)
- Access Log
- Password Recovery
- Recover Username
- Delete Your Account
- Statistics
- Activity Summary
- Groups
- Users
- Share Access
- Developers
- Enable the API
- Rest API
- Authentication
- Devices API
- GET /api/devices
- GET /api/devices/{deviceId}
- GET /api/devices/{deviceId}/lastLocation
- POST /api/devices/{deviceId}/locations
- POST /api/devices/{deviceId}/alerts
- Groups API
- GET /api/groups
- POST /api/groups
- GET /api/groups/{groupId}
- PUT /api/groups/{groupId}
- PATCH /api/groups/{groupId}
- DELETE /api/groups/{groupId}
- Users API
- GET /api/users
- POST /api/users
- GET /api/users/countries
- GET /api/users/timeZones
- GET /api/users/{userId}
- PUT /api/users/{userId}
- PATCH /api/users/{userId}
- DELETE /api/users/{userId}