Update a User

Last edit:  Sep 03, 2018

Contributors:  pavelloz

To update an user, send a PUT request to /api/users/:user_id

HTTP request

PUT /api/users/:user_id

Parameters

Parameter Type Description Required Notes
form_configuration_name String Name of the form configuration Required
form UserForm UserForm parameters that corresponds with FormConfiguration configuration Required

User Parameters

Parameter Type Description Required Notes
email String User's email address Required Default validation for presence, uniqueness, email format
external_id String custom external ID for the user, example in a third party database Optional
featured Boolean Whether the user is featured Optional
first_name String User's first name Optional
last_name String User's last name Optional
middle_name String User's middle name Optional
name String Name of the user Optional
password String password for the user Optional Default validation minimum 6 chars
profiles Hash[String=>UserProfileForm] Form for updating profiles for this user Optional
public_profile Boolean whether the profile has been marked as public Optional
relationship_users Hash[String=>RelationshipUserForm] Form for updating relationship users for this profile Optional
transactables Hash[String=>TransactableForm] Form for updating a user's transactable(s) Optional

Example request

"authorization: Token token=[YOUR API TOKEN]"
"accept: application/json"
"content-type: application/json"

{
  "form_configuration_name": "reference_rest_api_update_user",
  "form": {
    "first_name": "Example"
  }
}
Element Type Description Required?
form_configuration_name String Name of the defined FormConfiguration Required
form UserForm Attributes for user, should match configuration defined in corresponding FormConfiguration Required

Example response

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{}

Element Type Description
[…] […] […]

Error and Status Codes

Code Message Meaning
204 No Content Successfully fulfilled request
401 Unathorized Invalid Authentication
404 Not Found Can't find given resource
406 Not Acceptable Wrong parameters passed