📘 To update only a single field of a User, please use the PATCH method with the parameters that need to be changed.
To update all attributes of a specific User please make a PUT request to the following URL:
HTTP Method URL PUT https://industrial.api.ubidots.com/api/v2.0/users/<user_key>
Parameter Type Description user_key String The id or username of the User, username should use the prefix ~
Parameter Type Use Description token String Authentication Authorization Token can optionally be sent as a query parameter.
Parameter Type Required? Default Value username String Yes N/A (Required) firstName String No ""lastName String No ""email String Yes N/A (Required) defaultOrganization String No nulldefaultRole String No nulldefaultDashboard String No nulllanguage String No nullwebsite String No ""timezone String No nulldecimalPlaces Integer No nullnumberFormat String No nullisActive Boolean No Truetags List No []contactMethods List No []
Parameter Required? Description X-Auth-Token Yes Authentication Token of accountContent-Type Yes Content type of body: String (application/json)
cURL (Request)
$ curl -X PUT 'https://industrial.api.ubidots.com/api/v2.0/users/63d3f1247fefea000cd325af' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
-d '{
"firstName": "second",
"lastName": "lastName",
"language": null,
"timezone": null,
"decimalPlaces": 3,
"isActive": true,
"defaultOrganization": "62b4eb3519cd98007bf410bf",
"defaultRole": "patch1"
}'
200 OK 400 Bad Request 401 Unauthorized
{
"url": "https://industrial.api.ubidots.com/api/v2.0/users/63d3f1247fefea000cd325af",
"id": "63d3f1247fefea000cd325af",
"username": "testt",
"firstName": "second",
"lastName": "lastName",
"email": "[email protected] ",
"defaultOrganization": null,
"defaultRole": null,
"defaultDashboard": null,
"mugshotUrl": "//www.gravatar.com/avatar/1aedb8d9dc4751e229a335e371db8058?s=100&d=mm",
"language": null,
"website": "",
"timezone": null,
"decimalPlaces": 3,
"numberFormat": null,
"firstTime": true,
"properties": {
"password_update_timestamp": 1712608765455
},
"organizations": [
{
"url": "https://industrial.api.ubidots.com/api/v2.0/organizations/62b4eb3519cd98007bf410bf",
"id": "62b4eb3519cd98007bf410bf",
"label": "my-third-customer",
"name": "Cliente1",
"createdAt": "2022-06-23T22:37:41.840643Z",
"properties": {
"color": "#00796B"
},
"role": {
"url": "https://industrial.api.ubidots.com/api/v2.0/roles/patch1",
"label": "patch1",
"name": "patch1",
"createdAt": "2022-06-17T23:30:09.838765Z"
}
}
],
"organizationsCount": 1,
"isActive": true,
"lastLogin": "2023-01-27T15:48:11.420796Z",
"tags": [
"tag1",
"tag2"
],
"createdAt": "2023-01-27T15:43:32.549760Z",
"contactMethods": []
}{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}
Returns a User object of the updated User.