Loading...

PATCH /api/users/{userId}

To change one detail for someone who already has access to your Plaspy account, identify their sub-user and specify the fields to update. For example, you might correct the description your team uses to identify a dispatcher.

Put the sub-user ID in the request path and the list of changes in the body. The API applies them in order to the current profile, validates the result and returns the saved profile if it is valid. You can check the correction without resending the rest of the person’s details.

Request Details

PATCH /api/users/{userId}

The example identifiers are fictional. Use the identifiers returned by your account’s list for the resource you want to look up or change.

Request Parameters

Send a JSON array containing at least one operation.

Path parameters

ParameterTypeRequiredDescription
userIdStringRequiredStringYesPublic identifier of the sub-user. Use the usr-… value returned by the user list.

Fields in each operation

ParameterTypeRequiredDescription
opStringRequiredStringYesJSON Patch operation. The example uses replace.
pathStringRequiredStringYesField path to change, starting with /.
valueField typeConditionalField typeConditionalFor replace, supply the new value with the field’s type.

The body is an array of at least one operation. Each entry needs op and path. For replace, use a field path such as /name, /description or /disabled, and set value to the new value with the field’s type.

The login name in email stays the same. To restrict the access period, the resulting profile must have both from and expires. A new password must be at least 8 characters long and include uppercase, lowercase and a digit.

Authentication Required

Send the access token in the Authorization: Bearer <token> header. See Authentication.

Requires an administrator with access to Users. Demo users have read access only.

Example Request

PATCH /api/users/{userId} HTTP/1.1 Host: api.plaspy.com Authorization: Bearer {token} Content-Type: application/json

Example Request Body

[ { "op": "replace", "path": "/description", "value": "City routes" } ]

Response Parameters

The response returns the saved sub-user with their public ID, status and group or device assignment. Optional fields appear when applicable. The password is write-only and is omitted from the response.

FieldTypePresenceDescription
idStringAlwaysStringAlwaysPublic sub-user ID with the usr- prefix.
nameStringAlwaysStringAlwaysSub-user display name.
emailStringAlwaysStringAlwaysSub-user login name.
countryStringAlwaysStringAlwaysCountry code saved in the profile.
timeZoneStringAlwaysStringAlwaysProfile time zone.
descriptionStringWhen setStringWhen setDescription of the sub-user.
messageStringWhen setStringWhen setMessage configured for the sub-user.
disabledBooleanAlwaysBooleanAlwaysIndicates whether the sub-user is disabled.
disabledMessageStringWhen setStringWhen setMessage configured for a disabled sub-user.
tagsString mapWhen setString mapWhen setTags associated with the profile.
privilegesString arrayWhen setString arrayWhen setNames of assigned privileges.
groupStringWhen setStringWhen setPublic ID of the group or special access profile.
deviceIdStringWhen setStringWhen setTracker ID assigned to a sub-user with access to one device.
adminDevicesIntegerWhen setIntegerWhen setDevice licences allocated to an administrator who manages their own account.
fromDate-timeWhen setDate-timeWhen setStart of the configured access period.
expiresDate-timeWhen setDate-timeWhen setEnd of the configured access period.
creationDate-timeWhen setDate-timeWhen setProfile creation date and time, when available.
modificationDate-timeWhen setDate-timeWhen setMost recent profile modification date and time, when available.
lastLoginDate-timeWhen setDate-timeWhen setLast sign-in date and time, when available.
successBooleanAlwaysBooleanAlwaysIn a successful response, true confirms the operation.
apiUsageIntegerAlwaysIntegerAlwaysUnits charged for this request.
apiDailyUsageIntegerAlwaysIntegerAlwaysDaily usage before the units for this request are added.

Example HTTP 200 response (excerpt)

{ "id": "usr-NpQrMWxYvK", "name": "Morgan Lee", "email": "dispatch@example.com", "country": "CO", "timeZone": "America/Bogota", "deviceId": "123456789012345", "disabled": false, "description": "City routes", "success": true, "apiUsage": 1, "apiDailyUsage": 24 }

Errors

FieldTypePresenceDescription
successBooleanDepends on the errorBooleanDepends on the errorIn the operation errors shown here, the value is false.
errorStringDepends on the errorStringDepends on the errorMessage explaining why the request was rejected.
  • HTTP 401 if a valid Bearer token is missing.
  • HTTP 400 if the ID is recognised but the sub-user is outside the account or does not exist. HTTP 404 if the route or ID is unrecognised.
  • HTTP 400 with success: false and the reason in error if the list is empty or the result breaks a validation rule. An unknown field path or an incompatible value type can return HTTP 500.
  • HTTP 403 if the user lacks the required permission. The reason appears in error.

Example error

{ "success": false, "error": "No patch operations were provided." }
Index
Questions?

We answer all support request within 24 business hours approximately, If you have a question that needs an immediate resolution, please contact us by other way.

We answer you in business hours, as soon as possible. We are located in Bogotá, Colombia, time zone (GMT-5).

Last modification: 2026-11-30 11:49:27