Skip to main content
PUT
/
v2
/
vendor
/
users
/
{userId}
Update User
curl --request PUT \
  --url https://api.puppetvendors.com/v2/vendor/users/{userId} \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "approved": true,
  "notifications": true,
  "profile": {
    "profile.firstName": "<string>",
    "profile.lastName": "<string>",
    "profile.phone": "<string>"
  },
  "permission": {}
}
'
V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Update an existing user account belonging to the authenticated vendor. Only fields included in the request body are updated. Returns 404 if the user does not belong to the vendor.
Vendor Token Required — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error.

Use Cases

  • Update team member permissions or approval status
  • Reset a user’s password from the vendor portal

Path Parameters

userId
string
required
The user ObjectId to update.

Request Body

email
string
Updated email address. Must be a valid email format.
password
string
Updated password (minimum 6 characters).
approved
boolean
Whether the account is active.
notifications
boolean
Enable or disable email notifications.
profile
object
Updated profile information.
permission
object
Updated permission configuration object.

Response

200
{
  "success": true,
  "data": {
    "_id": "507f1f77bcf86cd799439022",
    "email": "updated@vendor.com",
    "type": "vendor",
    "approved": true,
    "profile": {
      "firstName": "Updated",
      "lastName": "User"
    },
    "notifications": true,
    "permission": {},
    "createdAt": "2024-06-15T12:00:00.000Z",
    "updatedAt": "2024-06-16T10:00:00.000Z"
  }
}

Error Responses

404
{
  "success": false,
  "error": "User not found"
}
409
{
  "success": false,
  "error": "A user with this email already exists"
}

Example

curl -X PUT "https://api.puppetvendors.com/v2/vendor/users/507f1f77bcf86cd799439022" \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \
  -d '{
    "approved": true,
    "profile": {
      "firstName": "Updated",
      "lastName": "User"
    }
  }'