Delete employee group
Deletes an employee group. Fails with 400 if the group is currently assigned to an employee or an expense category. Returns 403 when the authenticated user is not an administrator of the organization. Returns 404 when the employee group does not exist, or belongs to a different organization.
DELETE
/
organizations
/
{organizationId}
/
employeegroups
/
{employeeGroupId}
Delete employee group
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}', 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/{employeeGroupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"result": "error",
"code": "EMPLOYEE_GROUP_IN_USE",
"description": "This group is assigned to an employee or category and cannot be deleted."
}{
"result": "error",
"description": "Permission denied"
}{
"result": "error",
"code": "EMPLOYEE_GROUP_NOT_FOUND",
"description": "Employee group not found"
}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).
Example:
"11adfe2a080040e3892ffb89c21ec44e"
String (32-character hex string). The internal ID of the employee group to delete, as returned in the id field of the list, create, and update responses.
Example:
"3f2a9c1b8e7d4a6f9b0c1d2e3f4a5b6c"
Response
No Content — employee group successfully deleted
⌘I
Delete employee group
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}', 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/{employeeGroupId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/employeegroups/{employeeGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"result": "error",
"code": "EMPLOYEE_GROUP_IN_USE",
"description": "This group is assigned to an employee or category and cannot be deleted."
}{
"result": "error",
"description": "Permission denied"
}{
"result": "error",
"code": "EMPLOYEE_GROUP_NOT_FOUND",
"description": "Employee group not found"
}
