curl --request PUT \
--url https://api.hyperspell.com/connections/{connection_id}/folder-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changes": [
{
"provider_folder_id": "<string>",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"action": "set"
}
]
}
'import requests
url = "https://api.hyperspell.com/connections/{connection_id}/folder-policies"
payload = { "changes": [
{
"provider_folder_id": "<string>",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"action": "set"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changes: [
{
provider_folder_id: '<string>',
folder_name: '<string>',
folder_path: '<string>',
parent_folder_id: '<string>',
action: 'set'
}
]
})
};
fetch('https://api.hyperspell.com/connections/{connection_id}/folder-policies', 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://api.hyperspell.com/connections/{connection_id}/folder-policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'changes' => [
[
'provider_folder_id' => '<string>',
'folder_name' => '<string>',
'folder_path' => '<string>',
'parent_folder_id' => '<string>',
'action' => 'set'
]
]
]),
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://api.hyperspell.com/connections/{connection_id}/folder-policies"
payload := strings.NewReader("{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hyperspell.com/connections/{connection_id}/folder-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folder-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"policies": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_folder_id": "<string>",
"sync_mode": "sync",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Batch-apply folder policies for a connection
Apply a batch of folder-policy changes in a single transaction.
The connect-flow picker persists a whole selection at once. Doing that as N
sequential POST/DELETE calls means N HTTP round-trips and up to N
re-syncs (each SKIP->non-SKIP transition dispatched its own). This endpoint
upserts/deletes every change in one request and fires at most one re-sync
at the end, then prunes descendant rows a newly-selected ancestor made
redundant. Returns the connection’s full policy set after the changes.
curl --request PUT \
--url https://api.hyperspell.com/connections/{connection_id}/folder-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changes": [
{
"provider_folder_id": "<string>",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"action": "set"
}
]
}
'import requests
url = "https://api.hyperspell.com/connections/{connection_id}/folder-policies"
payload = { "changes": [
{
"provider_folder_id": "<string>",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"action": "set"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changes: [
{
provider_folder_id: '<string>',
folder_name: '<string>',
folder_path: '<string>',
parent_folder_id: '<string>',
action: 'set'
}
]
})
};
fetch('https://api.hyperspell.com/connections/{connection_id}/folder-policies', 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://api.hyperspell.com/connections/{connection_id}/folder-policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'changes' => [
[
'provider_folder_id' => '<string>',
'folder_name' => '<string>',
'folder_path' => '<string>',
'parent_folder_id' => '<string>',
'action' => 'set'
]
]
]),
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://api.hyperspell.com/connections/{connection_id}/folder-policies"
payload := strings.NewReader("{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hyperspell.com/connections/{connection_id}/folder-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folder-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changes\": [\n {\n \"provider_folder_id\": \"<string>\",\n \"folder_name\": \"<string>\",\n \"folder_path\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"action\": \"set\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"policies": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_folder_id": "<string>",
"sync_mode": "sync",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Path Parameters
Body
Folder-policy changes to apply in a single transaction
Show child attributes
Show child attributes
Response
Successful Response
List of folder policies
Show child attributes
Show child attributes
Was this page helpful?