Update existing users

Updating user information in Connecteam is essential for managing personnel details effectively, especially as roles and responsibilities change within your organization. The process is straightforward, adhering to specific guidelines that ensure accurate and efficient management of user data. Key guidelines to follow for updating users:

  • editUserByPhone: This field on the query params allows to edit users by their phone number in the system. If this flag is set to true - there is no need to specify userId, but the phoneNumber field. If you wish to update the user's phone number - the userId field must be specified. The default value of this param is set to false - meaning the unique identifier of the user must be specified in order to update user fields.
  • userType: As mentioned in the Create users page, there are 3 main user permissions: Owner, Admin and User. Currently the API supports 'user' and 'admin' types only. In order to promote a user to admin, use the users/v1/admin endpoint.
  • Custom Fields: Updating existing custom fields is allowed via the API. Please follow the same guidelines for updating the two different types of custom fields (Dropdown and Custom) on Create users page
  • isArchived: There are two options for archiving users: Update users or Delete users methods, which archives users without deleting them. To archive users using the Update Users method, you can do so either by phone number or user ID. Unarchiving users is possible only with the userId field to avoid duplication errors (while phone numbers are a unique value in our platform, archived users can have the same phone number).

🚧

Important note

You cannot update email field for admin type users via the API

👍

Good To Know

If you do not wish to update certain fields, there is no need to specify them. Our system will ignore unspecified fields in the request and consider only the specified fields

Payload example for update user request:

[
  {
    lastName: 'Vered Test',
    customFields: [{customFieldId: 111111, value: '798754'}],
    userId: 4343433
  }
]

Remarks

  • The update request is executed by the userId and not by phoneNumber
  • The user's last name is changed to another value (or it was specified even though there was no change); in both cases, the result will be the same.
  • The firstName, userType, emailAddress and any other unspecified fields will remain unchanged.
  • For the custom field ID (which represents the Direct Manager field), the value should be the userId of the selected direct manager. This field must reference a valid and active user on the platform.

Payload example for update user response:

{
  "requestId": "6eb6a2e9-37c8-42ab-962d-0ab75e60ea7c",
  "data": {
    "count": 1,
    "users": [
      {
        "firstName": "Omer ",
        "lastName": "Vered Test",
        "phoneNumber": "+9720548849980",
        "userType": "owner",
        "email": "[email protected]",
        "customFields": [
          {
            "customFieldId": 6208756,
            "value": "30/03/2024",
            "type": "date",
            "name": "Employment Start Date"
          },
          {
            "customFieldId": 6208760,
            "value": 7053346,
            "type": "directManager",
            "name": "Direct manager"
          },
          {
            "customFieldId": 7214214,
            "value": 19,
            "type": "number",
            "name": "Vacation Days"
          },
        ],
        "isArchived": false,
        "userId": 7031021,
        "createdAt": 1712573537,
        "modifiedAt": 1722862168,
        "lastLogin": 1722862074,
        "smartGroupsIds": [
          2359154,
          2359155,
          2392800
        ]
      }
    ]
  }
}

Remarks

  1. In the response body, all information about the user will be retrieved, including unspecified fields in the request.
  2. If the update wasn't successful (status 200 without updated fields or 4XX/5XX errors), please contact [email protected] and provide them the request id.

Update users API reference