Create employee group
Creates a new employee group for the given organization. Setting isDefault to true automatically unsets the organization’s previous default group, if any. Returns 403 when the authenticated user is not an administrator of the organization.
curl --request POST \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales Team",
"isDefault": false
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups"
payload = {
"name": "Sales Team",
"isDefault": False
}
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: 'Sales Team', isDefault: false})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups', 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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups",
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' => 'Sales Team',
'isDefault' => false
]),
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 := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups"
payload := strings.NewReader("{\n \"name\": \"Sales Team\",\n \"isDefault\": false\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("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales Team\",\n \"isDefault\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Sales Team\",\n \"isDefault\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3f2a9c1b8e7d4a6f9b0c1d2e3f4a5b6c",
"name": "Sales Team",
"isDefault": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
String. The organization's internal ID (32-character hex string).
"11adfe2a080040e3892ffb89c21ec44e"
Body
The id property must not be supplied — it is generated by the server and returned in the response.
Display name of the employee group. Must not be blank, is trimmed, and must be unique within the organization (case-insensitive).
255Whether this group should become the organization's default group. When the organization uses employee groups, users newly added to the organization are automatically assigned to the default group. Existing users are not moved to the group when it is set as default. Setting this to true automatically unsets the organization's previous default group, if any. Defaults to false when omitted.
Response
Created — returns the newly created employee group
Unique internal identifier of the employee group.
Display name of the employee group.
Whether this is the organization's default employee group. When the organization uses employee groups, users newly added to the organization are automatically assigned to the default group, when one is set. Existing users are not moved to the group when it is set as default. At most one group per organization can be the default at a time.
curl --request POST \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales Team",
"isDefault": false
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups"
payload = {
"name": "Sales Team",
"isDefault": False
}
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: 'Sales Team', isDefault: false})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups', 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://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups",
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' => 'Sales Team',
'isDefault' => false
]),
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 := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups"
payload := strings.NewReader("{\n \"name\": \"Sales Team\",\n \"isDefault\": false\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("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales Team\",\n \"isDefault\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Sales Team\",\n \"isDefault\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3f2a9c1b8e7d4a6f9b0c1d2e3f4a5b6c",
"name": "Sales Team",
"isDefault": false
}
