Create User
curl --request POST \
--url https://staging-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
}
'import requests
url = "https://staging-api.puppetvendors.com/v1/users"
payload = {
"vendorId": "<string>",
"email": "<string>",
"password": "<string>",
"sendEmail": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({vendorId: '<string>', email: '<string>', password: '<string>', sendEmail: true})
};
fetch('https://staging-api.puppetvendors.com/v1/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/v1/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vendorId' => '<string>',
'email' => '<string>',
'password' => '<string>',
'sendEmail' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.puppetvendors.com/v1/users"
payload := strings.NewReader("{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-api.puppetvendors.com/v1/users")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.puppetvendors.com/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}"
response = http.request(request)
puts response.read_bodyUsers
Create User
Create a vendor portal user account
POST
/
v1
/
users
Create User
curl --request POST \
--url https://staging-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
}
'import requests
url = "https://staging-api.puppetvendors.com/v1/users"
payload = {
"vendorId": "<string>",
"email": "<string>",
"password": "<string>",
"sendEmail": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({vendorId: '<string>', email: '<string>', password: '<string>', sendEmail: true})
};
fetch('https://staging-api.puppetvendors.com/v1/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/v1/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vendorId' => '<string>',
'email' => '<string>',
'password' => '<string>',
'sendEmail' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-api.puppetvendors.com/v1/users"
payload := strings.NewReader("{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-api.puppetvendors.com/v1/users")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.puppetvendors.com/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vendorId\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"sendEmail\": true\n}"
response = http.request(request)
puts response.read_bodyOverview
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
The vendor ID this user will be associated with.
User’s email address. Will be converted to lowercase.
Password for the vendor portal account.
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
}'
Was this page helpful?
⌘I