Project Membership
Remove Service Accounts From Projects
Removes a list of service account ids from a list of project ids
POST
/
organizations
/
{organizationId}
/
service-accounts
/
remove-from-project
Remove Service Accounts From Projects
curl --request POST \
--url https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"id": 123,
"service_account_ids": [
123
]
}
]
}
'import requests
url = "https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project"
payload = { "projects": [
{
"id": 123,
"service_account_ids": [123]
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{id: 123, service_account_ids: [123]}]})
};
fetch('https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project', 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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project",
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([
'projects' => [
[
'id' => 123,
'service_account_ids' => [
123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project"
payload := strings.NewReader("{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}Authorizations
Service Account
Path Parameters
Your organization id (eg: 12345)
Body
application/json
A list of projects and service accounts to remove
Show child attributes
Show child attributes
Response
Service accounts removed from projects
"ok" if the request succeeded, "error" otherwise.
Available options:
ok Example:
"ok"
Was this page helpful?
⌘I
Remove Service Accounts From Projects
curl --request POST \
--url https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"id": 123,
"service_account_ids": [
123
]
}
]
}
'import requests
url = "https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project"
payload = { "projects": [
{
"id": 123,
"service_account_ids": [123]
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{id: 123, service_account_ids: [123]}]})
};
fetch('https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project', 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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project",
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([
'projects' => [
[
'id' => 123,
'service_account_ids' => [
123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project"
payload := strings.NewReader("{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/app/organizations/{organizationId}/service-accounts/remove-from-project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projects\": [\n {\n \"id\": 123,\n \"service_account_ids\": [\n 123\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}{
"error": "<string>",
"status": "error"
}