Edit Users

There are two ways of editing an existing user

📘

Go to Create Users for reference on properties

Refer to the Create Users page to see the required and allowed properties to perform these operations.

1. Edit the user by providing only the properties that need to be updated

PATCH: /api/v3/users//

$ curl -X PATCH \
  https://www.zenput.com/api/v3/users/<user-id>/ \
    -H 'content-type: application/json' \
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
    "first_name": "new name",
}'

2. Replace the whole user

PUT: /api/v3/users//

$ curl -X PUT \
  https://www.zenput.com/api/v3/users/<user-id>/ \
    -H 'content-type: application/json' \
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
    "email": "[email protected]",
    "first_name": "first name",
    "last_name": "last name",
    "user_role": {
        "id": 1
    },
    "default_team": {
        "id": 1
    },
    "groups": [
        {
        "id": 1
    }
    ],
    "teams": [
        {
        "id": 1
    }
    ],
    "owned_locations": [
        {
        "id": 1
    }
    ]
}'

❗️

Don't forget the trailing slash!

Both PUT and PATCH requests need to have a trailing slash on the URL.