Delete user
Removes a user from the given organization. The user is marked as deleted and is no longer listed. It is also removed from the organization’s administrators, approvers and reminder receivers, its vehicles are removed from the organization’s fleet account, and any pending invitation to the organization for the user’s email address is withdrawn. The person behind the user keeps their users in other organizations.
When the organization requires a minimum number of users with the PRO license, its last PRO users can only be deleted when no other users remain; deleting one of them otherwise returns 403 with the code USER_CAN_NOT_BE_DELETED. When the organization is read-only, no user can be deleted and the request returns 403 with the code ORGANIZATION_READ_ONLY.
Returns 403 when the organization does not exist or the authenticated user is not an administrator of it, so a caller cannot tell an organization they lack access to from a missing one. Also returns 403 when the organization has no user with the given ID, including a user that is already deleted.
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId}"
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}/users/{userId}', 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}/users/{userId}",
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}/users/{userId}"
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}/users/{userId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId}")
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_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Required. String. Identifies the organization the user is deleted from. Accepts either the organization's internal ID (32-character hexadecimal string) or its externalSourceId (the string an integration set on the organization). This endpoint supports externalId: when the value has the format of an internal ID and an organization with that ID exists, the internal ID takes precedence; otherwise the value is looked up as externalSourceId.
Required. String. Identifies the user to delete, as returned in the id or externalSourceId field of the list response: either the user's internal ID (32-character hexadecimal string) or its externalSourceId (the non-empty string an integration set on the user). Only the users of the given organization are searched. This endpoint supports externalId: when a user of the organization has that internal ID, the internal ID takes precedence; otherwise the value is looked up as externalSourceId.
Response
No Content — the user was deleted
curl --request DELETE \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId}"
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}/users/{userId}', 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}/users/{userId}",
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}/users/{userId}"
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}/users/{userId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/users/{userId}")
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
