Update User

Updates an existing dashboard user. Use it to change contact information, reassign a role, or activate/deactivate the account.

HeaderRequiredDescription
AuthorizationYesBearer YOUR_ACCESS_TOKEN
Content-TypeYesapplication/json

Request Parameters

Path Parameters:

ParameterTypeRequiredDescription
location_idintegerYesLocation the user belongs to.
user_idintegerYesID of the user to update (the resource being modified).

Request Body Fields:

FieldTypeRequiredDescription
first_namestringNoUpdated first name.
last_namestringNoUpdated last name.
emailstringNoUpdated email address. Must remain unique.
phonestringnumberNo
role_idintegerNo1 location
2 admin
3 owner
statusintegerNo1 = active, 0 = inactive. Set 0 to deactivate.
user_idintegerNoThe acting user performing the request (distinct from the path user_id being edited).

Request Example

{
  "first_name": "Updated Name",
  "last_name": "Doe",
  "email": "[email protected]",
  "phone": 1234567898,
  "role_id": 2,
  "status": 0,
  "user_id": 2
}

cURL Example

curl --request PUT \
  --url https://sandbox-api.softpoint.io/interface/v1/locations/4004699/users/94 \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "first_name": "Updated Name",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": 1234567898,
    "role_id": 2
  }'

Success Response

{
  "id": 94,
  "first_name": "Updated Name",
  "last_name": "Doe",
  "phone": "+1 (123) 456-7898",
  "email": "[email protected]",
  "global_country_id": 3,
  "created_datetime": "2023-03-07T19:05:52.000000Z"
}

Response Fields

FieldTypeDescription
idintegerThe user's ID.
first_namestringCurrent first name.
last_namestringCurrent last name.
phonestringNormalized phone number.
emailstringCurrent email address.
global_country_idintegerAssociated country.
created_datetimestring (ISO 8601)Original creation timestamp (unchanged by updates).

Error Responses

User Not Found

Returned when the path user_id does not exist.

{
  "error": {
    "code": 10201,
    "message": "The selected user doesn't exist.",
    "details": null
  }
}

Status Codes

CodeDescription
200User updated
400Validation failed or user does not exist

Workflow Placement

Used during ongoing account maintenance, after a user has been created.

Notes

  • The user_id in the path is the user being edited; the user_id in the body identifies who is performing the edit.

  • Set status to 0 to deactivate a user without deleting the record.

  • A changed email must still be unique.

Common Mistakes

  • Confusing the path user_id (target) with the body user_id (actor).

  • Targeting a non-existent user ID (returns 10201).

  • Setting an email already used by another account.

Body Params
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json