Delete several owners
curl --request POST \
--url https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerIds": [
"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11",
"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33"
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner"
payload = { "ownerIds": ["3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11", "8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33"] }
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({
ownerIds: ['3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11', '8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33']
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner', 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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner",
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([
'ownerIds' => [
'3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11',
'8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33'
]
]),
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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner"
payload := strings.NewReader("{\n \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner")
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 \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ids": [
"<string>"
],
"notFound": [
"<string>"
],
"ignored": [
"<string>"
],
"rulesRemoved": 123,
"assetsAffected": 123
}
}{
"errors": [
{
"code": "NameTaken",
"message": "Payments already goes by \"payments\". Use that one instead."
}
]
}{
"message": "Forbidden"
}{
"message": "Internal server error"
}Delete several owners
Deletes up to 500 owners for good in one request, as Delete an owner does for one. IDs not found, such as owners already deleted, are listed in notFound, so a retry deletes nothing more. Requires Owner:Modify.
POST
/
v1
/
tenant
/
owners
/
not-an-owner
Delete several owners
curl --request POST \
--url https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerIds": [
"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11",
"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33"
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner"
payload = { "ownerIds": ["3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11", "8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33"] }
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({
ownerIds: ['3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11', '8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33']
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner', 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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner",
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([
'ownerIds' => [
'3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11',
'8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33'
]
]),
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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner"
payload := strings.NewReader("{\n \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\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://{region}.api.plerion.com/v1/tenant/owners/not-an-owner")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/owners/not-an-owner")
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 \"ownerIds\": [\n \"3f0c2a7e-1b8d-4c55-9a61-0d2f7e9b4c11\",\n \"8a1d4b2c-77e0-4f3a-b9c5-2e6d1f0a9b33\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ids": [
"<string>"
],
"notFound": [
"<string>"
],
"ignored": [
"<string>"
],
"rulesRemoved": 123,
"assetsAffected": 123
}
}{
"errors": [
{
"code": "NameTaken",
"message": "Payments already goes by \"payments\". Use that one instead."
}
]
}{
"message": "Forbidden"
}{
"message": "Internal server error"
}Authorizations
Headers
Was this page helpful?