Create a new user
curl --request POST \
--url http://localhost:{port}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_user",
"identifier": "ben",
"password": "<string>"
}
'import requests
url = "http://localhost:{port}/users"
payload = {
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_user",
"identifier": "ben",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Benjamin Zhang',
email: 'z@benwk.com',
user_type: 'saas_user',
identifier: 'ben',
password: '<string>'
})
};
fetch('http://localhost:{port}/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_PORT => "62437",
CURLOPT_URL => "http://localhost:{port}/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([
'name' => 'Benjamin Zhang',
'email' => 'z@benwk.com',
'user_type' => 'saas_user',
'identifier' => 'ben',
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:{port}/users"
payload := strings.NewReader("{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:{port}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:{port}/users")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "d4add56e-c345-4ac9-b392-7a890a60559a",
"identifier": "ben",
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_admin",
"status": "active",
"created_at": "2023-05-06T00:00:00Z",
"updated_at": "2023-05-06T00:00:00Z",
"created_by": "98d91cd7-860d-4869-937a-5af32eff2f4a",
"updated_by": "98d91cd7-860d-4869-937a-5af32eff2f4a"
}User
Create a new user
POST
/
users
Create a new user
curl --request POST \
--url http://localhost:{port}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_user",
"identifier": "ben",
"password": "<string>"
}
'import requests
url = "http://localhost:{port}/users"
payload = {
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_user",
"identifier": "ben",
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Benjamin Zhang',
email: 'z@benwk.com',
user_type: 'saas_user',
identifier: 'ben',
password: '<string>'
})
};
fetch('http://localhost:{port}/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_PORT => "62437",
CURLOPT_URL => "http://localhost:{port}/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([
'name' => 'Benjamin Zhang',
'email' => 'z@benwk.com',
'user_type' => 'saas_user',
'identifier' => 'ben',
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:{port}/users"
payload := strings.NewReader("{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:{port}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:{port}/users")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Benjamin Zhang\",\n \"email\": \"z@benwk.com\",\n \"user_type\": \"saas_user\",\n \"identifier\": \"ben\",\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "d4add56e-c345-4ac9-b392-7a890a60559a",
"identifier": "ben",
"name": "Benjamin Zhang",
"email": "z@benwk.com",
"user_type": "saas_admin",
"status": "active",
"created_at": "2023-05-06T00:00:00Z",
"updated_at": "2023-05-06T00:00:00Z",
"created_by": "98d91cd7-860d-4869-937a-5af32eff2f4a",
"updated_by": "98d91cd7-860d-4869-937a-5af32eff2f4a"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Your API version
Available options:
v1 Available options:
application/json, application/xml, application/x-www-form-urlencoded, application/octet-stream, application/pdf, text/plain, text/html, multipart/form-data Body
application/json
Response
Created
Example:
"98d91cd7-860d-4869-937a-5af32eff2f4a"
Example:
"ben"
Example:
"Benjamin Zhang"
Example:
"z@benwk.com"
Available options:
saas_admin, saas_user, saas_user_client Example:
"saas_user"
Available options:
active, onboarding, inactive, suspended, risky Example:
"active"
REQUIRE metadata permissions
Example:
"98d91cd7-860d-4869-937a-5af32eff2f4a"
REQUIRE metadata permissions
Example:
"98d91cd7-860d-4869-937a-5af32eff2f4a"
Was this page helpful?