Skip to main content
POST
/
v1
/
users
Create User
curl --request POST \
  --url https://api.puppetvendors.com/v1/users \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "vendorId": "<string>",
  "email": "<string>",
  "password": "<string>",
  "sendEmail": true
}
'

Overview

Creates a new vendor portal user account and optionally sends an invitation email with login credentials.

Use Cases

  • Automate vendor onboarding — create vendor + user account in one flow
  • Provision portal access for new team members of an existing vendor
  • Bulk-invite vendors by scripting account creation with sendEmail: true

Request Body

vendorId
string
required
The vendor ID this user will be associated with.
email
string
required
User’s email address. Will be converted to lowercase.
password
string
required
Password for the vendor portal account.
sendEmail
boolean
Set to true to send an invitation email with login credentials to the user.

Response

200
{
  "message": "User created successfully.",
  "user": {
    "_id": "61a2b3c4d5e6f7g8h9i0j1k2",
    "email": "vendor@acme.com",
    "type": "vendor",
    "vendorId": "6157faecbebcf01bf49097d9",
    "approved": true,
    "createdAt": "2024-01-15T08:00:00.000Z"
  }
}
The password is stored as a bcrypt hash. It cannot be retrieved after creation. If sendEmail is true, the plaintext password is included in the invitation email.

Example

curl -X POST https://api.puppetvendors.com/v1/users \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_JWT_TOKEN" \
  -d '{
    "vendorId": "6157faecbebcf01bf49097d9",
    "email": "vendor@acme.com",
    "password": "securePassword123",
    "sendEmail": true
  }'