curl --request POST \
--url https://api.partoo.co/v2/user \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"first_name": "Perceval",
"last_name": "de Galles",
"org_id": 42,
"accesses": [
[
1,
2
],
[
1,
3
]
],
"business_ids": [
"<string>"
],
"role": "BUSINESS_MANAGER",
"custom_role": "my_custom_role",
"sidebar_pages": [],
"send_invitation": false,
"status": "active",
"password": "<string>",
"lang": "fr",
"sso_only": false
}
'import requests
url = "https://api.partoo.co/v2/user"
payload = {
"email": "jsmith@example.com",
"first_name": "Perceval",
"last_name": "de Galles",
"org_id": 42,
"accesses": [[1, 2], [1, 3]],
"business_ids": ["<string>"],
"role": "BUSINESS_MANAGER",
"custom_role": "my_custom_role",
"sidebar_pages": [],
"send_invitation": False,
"status": "active",
"password": "<string>",
"lang": "fr",
"sso_only": False
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
first_name: 'Perceval',
last_name: 'de Galles',
org_id: 42,
accesses: [[1, 2], [1, 3]],
business_ids: ['<string>'],
role: 'BUSINESS_MANAGER',
custom_role: 'my_custom_role',
sidebar_pages: [],
send_invitation: false,
status: 'active',
password: '<string>',
lang: 'fr',
sso_only: false
})
};
fetch('https://api.partoo.co/v2/user', 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://api.partoo.co/v2/user",
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([
'email' => 'jsmith@example.com',
'first_name' => 'Perceval',
'last_name' => 'de Galles',
'org_id' => 42,
'accesses' => [
[
1,
2
],
[
1,
3
]
],
'business_ids' => [
'<string>'
],
'role' => 'BUSINESS_MANAGER',
'custom_role' => 'my_custom_role',
'sidebar_pages' => [
],
'send_invitation' => false,
'status' => 'active',
'password' => '<string>',
'lang' => 'fr',
'sso_only' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-APIKey: <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://api.partoo.co/v2/user"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-APIKey", "<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://api.partoo.co/v2/user")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "5309c3a237bbc544d8e26737",
"status": "success"
}{
"errors": {
"json": {}
}
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}Create user
This endpoint lets you create a user. If no password given, a password will automatically be generated.
The password will be ignored if send_invitation is set to True.
You need to have WRITE access on the organization of the user you want to create.
If you want to have an invited user but send the invitation email later, you have to send the send_invitation parameter as False and a status parameter to invited.
You will then have to call the invitation endpoint to send the invitation email to the user.
curl --request POST \
--url https://api.partoo.co/v2/user \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"first_name": "Perceval",
"last_name": "de Galles",
"org_id": 42,
"accesses": [
[
1,
2
],
[
1,
3
]
],
"business_ids": [
"<string>"
],
"role": "BUSINESS_MANAGER",
"custom_role": "my_custom_role",
"sidebar_pages": [],
"send_invitation": false,
"status": "active",
"password": "<string>",
"lang": "fr",
"sso_only": false
}
'import requests
url = "https://api.partoo.co/v2/user"
payload = {
"email": "jsmith@example.com",
"first_name": "Perceval",
"last_name": "de Galles",
"org_id": 42,
"accesses": [[1, 2], [1, 3]],
"business_ids": ["<string>"],
"role": "BUSINESS_MANAGER",
"custom_role": "my_custom_role",
"sidebar_pages": [],
"send_invitation": False,
"status": "active",
"password": "<string>",
"lang": "fr",
"sso_only": False
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
first_name: 'Perceval',
last_name: 'de Galles',
org_id: 42,
accesses: [[1, 2], [1, 3]],
business_ids: ['<string>'],
role: 'BUSINESS_MANAGER',
custom_role: 'my_custom_role',
sidebar_pages: [],
send_invitation: false,
status: 'active',
password: '<string>',
lang: 'fr',
sso_only: false
})
};
fetch('https://api.partoo.co/v2/user', 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://api.partoo.co/v2/user",
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([
'email' => 'jsmith@example.com',
'first_name' => 'Perceval',
'last_name' => 'de Galles',
'org_id' => 42,
'accesses' => [
[
1,
2
],
[
1,
3
]
],
'business_ids' => [
'<string>'
],
'role' => 'BUSINESS_MANAGER',
'custom_role' => 'my_custom_role',
'sidebar_pages' => [
],
'send_invitation' => false,
'status' => 'active',
'password' => '<string>',
'lang' => 'fr',
'sso_only' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-APIKey: <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://api.partoo.co/v2/user"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-APIKey", "<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://api.partoo.co/v2/user")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"Perceval\",\n \"last_name\": \"de Galles\",\n \"org_id\": 42,\n \"accesses\": [\n [\n 1,\n 2\n ],\n [\n 1,\n 3\n ]\n ],\n \"business_ids\": [\n \"<string>\"\n ],\n \"role\": \"BUSINESS_MANAGER\",\n \"custom_role\": \"my_custom_role\",\n \"sidebar_pages\": [],\n \"send_invitation\": false,\n \"status\": \"active\",\n \"password\": \"<string>\",\n \"lang\": \"fr\",\n \"sso_only\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "5309c3a237bbc544d8e26737",
"status": "success"
}{
"errors": {
"json": {}
}
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}Authorizations
Body
Request body to create a user
List of (list of Group ID).
Accesses of the users for the new groups system, only for GROUP_MANAGER users.
[[1, 2], [1, 3]]
Optional API identifier of a custom role to assign to the user. The value must match the api_id of one of the custom roles available to your organization.
If no custom role is given, users with the role GROUP_MANAGER or BUSINESS_MANAGER will automatically be assigned to the default built-in custom role associated with their role.
For more information about custom roles, see Managing User Permissions with Custom Roles
"my_custom_role"
DEPRECATED: This parameter is deprecated in favor of the new Custom Roles system. See the Custom Roles & Permissions guide for migration information.
List of features the user can access from the sidebar.
If not provided in the payload or set to null, then the user will be given all the available features of their organization.
Sidebar page feature name
bulk_modification, diffusion, feedback_management, messages, posts, presence_analytics, review_analytics, review_invite, review_management Send an invitation email to the User.
If you want to have an invited user but send the invitation email later, you have to send the send_invitation parameter as False and a status parameter to invited.
You will then have to call the invitation endpoint to send the invitation email to the user.
Was this page helpful?